Question about jQuery selector
5 answers
var s = $('#foo span');
$('#foo').text("hello").append(s);
Demo: http://jsfiddle.net/uTNTF/
Or, if updating HTML is an option, then just wrapping it yyyin <span>will make your life a lot easier:
$('#foo span:first-child').text("hello");
+6
"yyy" DOM node. jQuery - , DOM .
See here (your question may be seen as a duplicate of this): How to select text nodes using jQuery?
0