how to create this type of code, if you click in get code button, you will redirect to another tab of the eCommerce store and coupon code will appear after you click on it.
Asked
Active
Viewed 75 times
3 Answers
2
Html
// use button
<button onclick="Redirectpage()">Coupon Code</button>
// use Img
<img src="" onclick="Redirectpage()"/>
Javascript
function Redirectpage() {
location.href = "Put Your website here;
}

Zulu
- 8,765
- 9
- 49
- 56

Sumit patel
- 3,807
- 9
- 34
- 61
-
not working, maybe i am doing some mistake, can you provide me proper code, please i am not from technical field. – sandeep singh Rawat Jul 21 '16 at 07:04
0
<a href="<your new link here>" target="_blank" class="coupon_code">Coupon Code</a>
In your javascript code
$(document).ready(function(){
$(".coupon_code").click(function(){
// place your javascript code for open popup of coupon code
return true; // it will redirect to href link in new tab
});
});

Haresh Vidja
- 8,340
- 3
- 25
- 42
0
Try this one;
$('button').on('click',function()({
`$(this).html('your coupon code here');`
` window.open('https://link.com', '_blank');
});

Kallol Pratim
- 56
- 1
- 9