jquery - Exchange h3 header text with some other text -
i've got header other elements inside. e.g.:
<h3 id="header" > <span ...></span> title <img ...> </h3>
i want replace "title"
other text. thats tried:
$("#header").contents().filter(function(){return this.nodetype == 3;}).text("some other text");
but nothing happens here...
you can do:
$('#header').contents().filter(function () { return this.nodetype === 3 && $.trim(this.nodevalue).length; }).replacewith('some other text');
Comments
Post a Comment