Home:ALL Converter>Javascript Modules/Decoupling with DOM elements

Javascript Modules/Decoupling with DOM elements

Ask Time:2014-10-25T10:06:38         Author:amura.cxg

Json Formatter

I'm currently working on parts of a large Javascript application that deals a lot with DOM elements. I wanted to start making modules/start decoupling some of the code. I found some decent examples but one of the things I can't figure out is how to I create the DOM elements and interact with them? Should the Javascript be responsible for creating the DOM elements or should the Javascript take in a reference to the DOM elements or should the Javascript just assume that the elements will be there?

Any help on this would be greatly appreciated and if I'm incorrect in anyway I'd appreciate the corrections :)

Author:amura.cxg,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/26558686/javascript-modules-decoupling-with-dom-elements
yy