javascript - JQuery remove link target attribute code not working -
we have wp site uses 3d cart plugin - when click on "add cart" opens new window. because *'target='_new''* built plugin link code. see following page , click on product description or add cart button.
http://tipsybir.nextmp.net/freestyle-hummingbird-feeders-375ml/
to override this, use code:
<script type="text/javascript"> jquery(document).ready(function() { $("a[target='_new']").removeattr("target"); }); </script> which got previous question here. have wp site using same plugin, , above code works perfect, not working on site. same exact code, placed in header, new window still opened.
can on this? not want new window open.
you not using jquery noconflict, use jquery instead of $
jquery(document).ready(function() { jquery("a[target='_new']").removeattr("target"); });
Comments
Post a Comment