When adding text to an element, jQuery's append() function adds quotation marks around text. I want to change that, and instead separate values by comma or whatever I come up with. Is there an alternative to append() that will do that ?
To give it some context, I'm using jQuery to dynamically write to a hidden <input>
element.
Currently after a few additions (using append) the resulting HTML looks like this:
<input type="hidden">"first"
"second"
"third"
</input>
In an ideal world, the HTML should come out looking like this:
<input type="hidden">first, second, third</input>
Using jQuery to read, concatenate, and then replace the original <input>
text might work, but I don't see a function that will do a wholesale replace of innerHTML (I'm assuing it's called that).
Thoughts ?