javascript - Changing a "target=_" in a hardcoded href link -


we have wordpress site uses 3dcart widget - dynamically populates products section of page. see page example

http://www.slipcovermall.com/chairs/wing-chair/

the issue is, plugin hardcodes "target="_new" in each product link, when click on "add cart" taken new browser window. there javascript way in page header change target called self, or remove target= altogether?

using jquery (which included on page, assume it's ok):

jquery(document).ready(function() {     jquery("a[target='_new']").removeattr("target"); }); 

if jquery not available, use

document.queryselectorall("a[_target='new']") 

iterate on elements , invoke removeattribute("target"):

var links = document.queryselectorall("a[target='_new']"); for(var = 0; < links.length; i++) {     links[i].removeattribute("target"); } 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -