i am a beginner to java script.i do the bellow code for changing the text color into red using java script.But it doesn't work.what is the error in my code?
<!DOCTYPE html> <html> <head> <script> function display() { var col=document.getElementById("demo").innerHTML; col.style.color="red"; } </script> </head> <body> <h1>My First JavaScript</h1> <p id="demo">click on the button bellow.....</p> <button onclick="display()">Display</button> </body> </html>