Javascript querySelectorAll not working with class

I’ve write a simple JavaScript code to show time. I want to show this javascript value or output in multiple place. That’s why I followed querySelectorAll method. But it now working… Look at my code; `<p class="mm"></p> <h1 class="mm"></h1> <script type="text/javaScript"> var date = new Date(); document.querySelectorall(".mm").innerHTML = date; </script>` How can I do it… Read More Javascript querySelectorAll not working with class

How to find from elements with one to multiple class names just the ones which feature exactly a specific and sole class name (and not any other)?

Example: <div class="parent"> <div class ="parent father"> const soleParentClassElementList = document.querySelectorAll(‘.parent’) With the above code line I would query both element nodes, but I want to query just the one(s) with a single parent class. >Solution : this way… const onlyParent = document.querySelector(‘[class=”parent”]’) onlyParent.textContent = ‘this one’ <div class =”parent father”>…</div> <div class=”parent”> … </div>