manipulate html js code example
Example 1: can we manipulate the html elements
<!DOCTYPE HTML><html> <head> <title>This is the title</title> </head> <body> <p id="paragraph-1" class="class-1">This is a paragraph.</p> <ul>This is a list <li class="class-1">Item 1</li> <li>Item 2</li> <li class="class-1">Item 3</li> </ul> </body></html>
Example 2: can we manipulate the html elements
document.body; // This is the object corresponding to the <body> tag