I have html below. What I want to do depends on some conditions. I want to save the text Sometitle.
<div id="header">
Sometitle
<div>
<div>
aa
</div>
<div>
bb
</div>
</div>
</div>
I tried using jQuery below, but it removes other divs as well.
$("#header").text("Its a thrusday today !");
How should I do it? I cannot change this HTML code anyway. I just need to use jquery and do this.
Here is the generated jsfiddle: http://jsfiddle.net/qYUBp/
source
share