I\'d like to store a some HTML/XML markups in a javascript variable. The problem is that the text is relatively large. For example how can I store the following XML piece in a j
I think you might have wanted to store html/xml code in javascript and display in textarea or some other input elements. If this is your intention this will help you.
Instead of javascript variable, store your code in a div and hide using css ex: display:none
. When you want to show the code, you can use $('#div id').text()
.