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'); 

fiddle demo


Comments

Popular posts from this blog

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -