¡@

Home 

2014/10/16 ¤W¤È 12:02:22

jquery Programming Glossary: carton

Wrap text with <span> element using Javascript or jQuery

http://stackoverflow.com/questions/8652953/wrap-text-with-span-element-using-javascript-or-jquery

no containing element it's just in the body . b SqFt per Carton b 24.30 br Using script I want to wrap 24.30 in a span tag with.. with a class so the result will look like this b SqFt per Carton b span class sqft_cart 24.30 span br How can I do this javascript.. bs.length index if bs index .innerHTML.indexOf 'SqFt per Carton ' 1 var text bs index .nextSibling span ' span class sqft_cart..

Wrap text with <span> element using Javascript or jQuery

http://stackoverflow.com/questions/8652953/wrap-text-with-span-element-using-javascript-or-jquery

jQuery I have the following HTML code on my page. There is no containing element it's just in the body . b SqFt per Carton b 24.30 br Using script I want to wrap 24.30 in a span tag with a class so the result will look like this b SqFt per Carton.. b 24.30 br Using script I want to wrap 24.30 in a span tag with a class so the result will look like this b SqFt per Carton b span class sqft_cart 24.30 span br How can I do this javascript jquery html share improve this question Since you.. bs document.getElementsByTagName 'b' for var index 0 index bs.length index if bs index .innerHTML.indexOf 'SqFt per Carton ' 1 var text bs index .nextSibling span ' span class sqft_cart ' text.nodeValue ' span ' text.parentNode.removeChild text..