varEl = Document.createelement ('Pre');//Create <pre></pre> elementsEl.id ='SSS';//Add ID <pre id= "sss" ></pre>Document.body.appendChild (EL);//add it to the bottom of the body.El = document.getElementById ('SSS');//Access Dom gets this element based on the IDel.innerhtml='<p>temp</p>';//add content to it <pre id= "SSS" ><p>temp</p></pre>varText = document.createTextNode ('BBQ');//Create a text nodeEl.appendchild (text);//Append text node <pre id= "SSS" > <p>temp</p> "BBQ" </pre>//Console.log (EL);
El.style.display ='None';//set the inline style for itEl.addeventlistener ('Click', FireClick,false);//Add a click event to an element//add clicks to IE 8 and belowif(!El.addeventlistener) {El.attachevent ('onclick', FireClick);}Else{El.addeventlistener ('Click', FireClick,false);//for compatibility reasons}function FireClick () {Console.log ('Click');}
Common Native Client JS