javascript - JQuery selector with both a selector and not-selector -


i have following jquery function:

$('article.node--article p, .video-title').highlightwordandscroll({     words       : search_word,     tag         : '<span class="found_keyword">',     closingtag  : '</span>', }, scrollto); 

which wraps class found_keyword around search_word. nothing more. between <p> tags <img>tags. , because found_keyword class wrapped around image name, image isn't rendered anymore.

<p class="rtecenter">    <img alt="" src="/sites/default/files/userfiles/logo_&lt;span class=" found_keyword"="">foto.jpg" style="height:87px; width:332px"&gt; </p> 

and so, image-rendering broken. there way exclude image tag in jquery selector?

edit
link. i've tried following code, no luck there...

$('article.node--article p, .video-title').children().not("img").highlightwordandscroll({     words       : search_word,     tag         : '<span class="found_keyword">',     closingtag  : '</span>', }, scrollto); 

why don't more jquery remove classes after, img tags only


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -