April 4, 201412 yr I was reading on the W3 site about Nodes and came across this script <div id="div1"> <p id="p1">This is a paragraph.</p> <p id="p2">This is another paragraph.</p> </div> <script> var para=document.createElement("p"); var node=document.createTextNode("This is new."); para.appendChild(node); var element=document.getElementById("div1"); element.appendChild(para); </script> The structure above is classic inheritance insertion. My problem is, what purpose does this structure have in the web industry? What kind of problem would this structure solve? Edited April 4, 201412 yr by drt_t1gg3r
April 5, 201412 yr This kind of stuff is very rarely used now. Developers would tend to go with a templating system. An example of a templating system is Handlebars.js. Underscore,is also good for templating. Quite a lot of the articles on W3 Schools are old and not updated with more modern methods. Check out https://developer.mozilla.org/en-US/ it's a far better resource than W3 Schools.
April 5, 201412 yr Author EDIT: aw I see now. ty very much for pointing me in a new direction. Edited April 5, 201412 yr by drt_t1gg3r
Create an account or sign in to comment