I need help accessing the element with the class "hs-input" within this structure:
<div class = "hbspt-form".......>
<form ....class="hs-form stacked">
<div class = "hs_firstname field hs-form-field"...>
<div class = "input"....>
<div class="hs-input"...>
This is what I have attempted so far:
<script type="text/javascript">
var list = document.getElementsByClassName("hbspt-form")[0];
list.style.background = "#fffbd5";
list.style.borderRadius = "5px";
list.style.border= "solid";
list.style.boxShadow = "10px 20px 30px ";
list.style.borderColor = "#f7761f";
list.getElementsByClassName("hs_firstname")[0].style.backgroundColor = "white";
</script>
I am struggling to access even the second class (hs-form stacked). Can anyone provide guidance on how to change the background color of the last class (hs-input)?
Note: Although the console does not display any errors, it indicates that the code cannot be found when executed.
As a newcomer to JavaScript and Stack Overflow, I appreciate your patience and assistance. Thank you!
For reference, here is the code link: http://jsfiddle.net/jg2rek1h/