I'm having trouble in getting the exact value of href only. Here is the code:
Link:
<a href="monthly"></a>
Script:
'a': function(target, process){
if(process == "stripe"){
document.location.href = "/accounts/stripe/payment"+target[0].href;
}else{
......
}
},
If I run this the output will be:
http://localhost:8000/accounts/stripe/paymenthttp://localhost:8000/monthly/
Notice that the localhost is duplicating. How to get only the "monthly" in href without that localhost? I try target only but it's undefined. I try target[1] but it's not working.
Try target[0].getAttribute("href")
to get the literal attribute's content.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With