Let's say I have a dictionary site, and in one div I show a word, its definition and example. I need to reference these lines somewhere else. Is it possible to just pull them out of a div (find an element by Id, get the value), or is it better to create an object representing everything in this div and avoid the DOM when I need to request its values?
Further Explanation: Someone may click an element on the page (the element simply displays the word), and in another div displays the definition and example of this word (the element is associated with an object that contains all this information). This other div has text fields that display a definition and an example. I want someone to be able to edit the text there and then update the values in the word object. Should I just get the text from these text areas and send it to the word object, or do I need to create an "edit div" object containing lines in the text areas and just send the values between the two objects?
source
share