Jess McKenzie Jess McKenzie - 1 year ago 68
jQuery Question

Change a href url on page load

Is there a quick and easy way to change/overwrite a

url sturcture on page load?

The HTML structure is very basic:


<ul class="sub_menu" style="visibility: hidden;">
<li><a href="value">someLink</a></li>

Answer Source

Try this it works

$(document).ready(function() {
 $('a[href*="value"]').attr('href' , 'your url');


$(document).ready(function() {
 $('ul.sub_menu li a[href=value]').attr('href' , 'your url');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download