The following jquery script will update the href value of all the anchor links those
available in a web page to a static url http://www.tecrocks.com.
$('a[href]').attr('href', 'http://www.tecrocks.com');
This will be helpful for the situation like displaying the webpage content in a custom print preview page like so.
The following block will update all the href value in page without considering the element of the href value.
$('[href]').each(function () {
$(this).attr('href', 'http://www.tecrocks.com');
});
Using *= filders with in [] we can filter the href url's.
No comments:
Post a Comment