I am trying to change the attribute of an <a> tag using jQuery but it's not working. I am trying to change the src attribute of the <a> tag from www.google.com to www.somewebsite.com. Can anyone please tell me where I am getting it wrong.
<p class="form-row text-varient">
<label class="checkbox">
Some text here
<a target="_blank" href="http://google.com">Link Text</a>
</label>
</p>
jQuery(document).ready(function(){
jQuery(".text-varient").find("a").attr("href", "http://www.somewebsite.com/");
});
.termscome from? It's not visible in your provided HTML.termselement? The only reason this code wouldn't work is if that element is not in the source.terms?