I have a string of HTML contained in a var called “content”. The string of HTML contains a span with an id, eg:
<span id="valuespan">This is the value of a text box</span>
I want to use whatever is contained between the span tags as a value for a check box, but im not really sure how to do this.
Can anyone help me out?
Thanks!
This assumes the span string is not in the page. I wrapped the content variable in an extra div which assures can use
findregardless of what level of html hirarchy the span is onDEMO: http://jsfiddle.net/8WZJT/