I was writing a small javascript function if I click in the element where class name is clickme it will change the html of demo class.but it is not working.it is working if I change it to an id what is the reason of it.
<p id="clickme">Click Me</p>
<p class="demo"></p>
<script>
document.getElementsByClassName("clickme").addEventListener("click",
function(){
document.getElementsByClassName("demo").innerHTML = "Hello World";
});
</script>