in javascript has some methods to to change the internal data, style and attributes.
- element.innerHTML
- element.style.style-name
- element.setAttribute
- element.attribute
<!DOCTYPE html> <html lang='en' xmlns='http://www.w3.org/1999/xhtml'> <head> <meta charset='utf-8' /> <title></title> <style> .page { background-color:green; } </style> </head> <body> <p id='p2'>Some data is available</p> <p id='p3'>Some data is available</p> <p id='p1'>Some data is available</p> <script> document.getElementById('p2').innerHTML += ' this is inner HTML'; document.getElementById('p3').setAttribute('class', 'page'); document.getElementById('p1').style.backgroundColor='red'; </script> </body> </html>