I can't figure out I want when I press button and selected all paragraphs and changing font-color but I cant I was trying
<script>
var colorChanger = document.getElementsByTagName("button")[0];
colorChanger.addEventListener("click",function() {
document.querySelector('p').style.color = "blue";
});
</script>
working code but only 1 paragraph so after I was trying
<script>
var colorChanger = document.getElementsByTagName("button")[0];
colorChanger.addEventListener("click",function() {
document.querySelectorAll('p').style.color = "blue";
});
</script>
doesn't work ...
I tried giving the same id tag to all the paragraphs, but again only 1 of them worked.