/ Published in: JavaScript

This will only work in FF 3.5 and web-kit browsers. (post 06/20/2009)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<!DOCTYPE html> <html> <head> <title></title> </head> <body> <p id="hello"> </p> <p class="goodbye"> </p> <script> // Gather the elements var i = document.querySelector("p#hello"); i.innerHTML = "Hello World"; var j = document.querySelector("p.goodbye"); j.innerHTML = "Good Bye!"; </script> </body> </html>
Comments
