<a class="button"
onclick="location.href = 'https://www.getthishref.com';"
</a>
Anyone have an idea on what the selector might look like for this? I'm looking to extract the https://www.getthishref.com.
<a class="button"
onclick="location.href = 'https://www.getthishref.com';"
</a>
Anyone have an idea on what the selector might look like for this? I'm looking to extract the https://www.getthishref.com.
You have to first get 'onclick' value, then use regular expressions:
const onclick_val = $('a.button').attr('onclick');
const regex = /'(.*?)'/g;
const found = onclick_val.match(regex);