We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE


   <title>My Document</title>
   <script type="text/javascript">
   function change() {
     // document.getElementsByTagName("H1") returns a NodeList of the h1
     // elements in the document, and the first is number 0:
     var header = document.getElementsByTagName("H1").item(0);
     // the firstChild of the header is a Text node:
     header.firstChild.data = "A dynamic document";
     // now the header is "A dynamic document".
     var para = document.getElementsByTagName("P").item(0);
     para.firstChild.data = "This is the first paragraph.";
     // create a new Text node for the second paragraph
     var newText = document.createTextNode("This is the second paragraph.");
     // create a new Element to be the second paragraph
     var newElement = document.createElement("P");
     // put the text in the paragraph
     // and put the paragraph on the end of the document by appending it to
     // the BODY (which is the parent of para)
   <input type="button" value="Change this document." onclick="change()">

Document Tags and Contributors

 Contributors to this page: mk7087, teoli, NickolayBot, Andreas Wuest, Nickolay, Gor1
 Last updated by: mk7087,