I need to change the color of testhtml background to blue on

I need to change the color of test.html background to blue once the user hits Change Color button. Test.html contains nothing inside and is white. How do i do this? here is the code that opens up test.html currently. It must be css and html only:

<tr>
       <td> Background</td>
       <td> Adds a background color to a webpage</td>
       <td> <button onclick=\'window.open(\"Test.html\")\'>Change color</button>
   </tr>

Solution

<tr>
       <td> Background</td>
       <td> Adds a background color to a webpage</td>
       <td> <button onclick=\'window.open(\"Test.html\")\'\"MyFunction()\">Change color</button>

<script>
function myFunction() {
document.body.style.backgroundColor= \"Blue\";
}
</script>


   </tr>

I need to change the color of test.html background to blue once the user hits Change Color button. Test.html contains nothing inside and is white. How do i do t

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site