Javascript examples for DOM:Quiz
Use the getElementsByClassName method to find the <p> element, and change its text to "yes".
<!DOCTYPE html> <html> <body> <p class="test">Use the DOM to change my text!</p> <script> document.getElementsByClassName("test")[0].innerHTML = "yes"; </script>//w w w . ja va 2s . co m </body> </html>