I have something like <p> <b> old</b> </p>
I want to replace current text inside bold tag such that result is <p> <b> new</b> </p> tag when user clicks on the parent .
I am using jquery like $(this > "b").text("new"); and $(this).children("b").text("new"); but it is not working?
Any help is appreciated..
$(this).children("b").text("new");should work fine if you correctly get<p>element asthis.<p>contain only abtag you can use children as this :$(this).children().text("new");. are you sure thatthismean theptag ?