I'm trying to use a with js script on HTML to change the color of all the paragraphs in my document.
So far I have used:
<button type="button" onclick="document.getElementsByClassName('paragraph').style.color='white'">white Font all</button>
and also
<button type="button" onclick="document.getElementsByTagName('p').style.color='white'">white Font all</button>
but it doesn't seem to work. I want to change the color of all the paragraph fonts in my document to white, or any color. I used ID and it works fine for 1 paragraph, but I need all of them at the same time.
<button type="button" onclick="document.getElementsById('intro').style.color='white'">white Font Intro</button>
Thanks for any help!