Why come empty arrays?

Can't understand why getElementById everything works but if I write instead of id class
we come empty arrays
5df9121ebb6f3977150600.jpeg

<div class="fonForm"></div>
 <div class="divClassForm fonForm divWindow" >
 <form action="" >

 <div class="styleClouse ">
 <div class="div_styleClouseOne"></div>
 <div class="div_styleClouseTwo"></div>
</div>
 <p>to request a call back</p>
 <!-- <span class="close">&times;</span> -->
 <input type="text" placeholder="Your name" class="texName">
 <input type="text" placeholder="Your phone number" class="textNumbre">
 <input type="submit" value="Oduvil request a call" class="btnForm" >
</form>
</div>


<code lang="javascript">
let divClassForm = document.getElementsByClassName("divWindow");

console.log(divClassForm);
let block = document.getElementsByClassName("idBtnForm");
console.log(block);
let clouse = document.querySelector(".styleClouse");
let fonForm = document.querySelector(".fonForm");

block.onclick = function() {
 divClassForm.style.display = "block";
 fonForm.style.display = "block";
};
clouse.onclick = function() {
 divClassForm.style.display = "none";
 fonForm.style.display = "none";
};

</code>


https://jsfiddle.net/7x56f0d8/3/
April 3rd 20 at 18:25
2 answers
April 3rd 20 at 18:27
let divClassForm = document.getElementsByClassName(".divWindow");


why does the dot in the class name of the item, if you are applying to the class?
without it is also not working - Adolphus.Schoen commented on April 3rd 20 at 18:30
April 3rd 20 at 18:29
div class="divClassForm fonForm" class="divWindow"
Two of the attribute class

Find more questions by tags JavaScriptHTML