Code for preventing an hyperlink from going to its href?

Kmandapalli
Posted by Kmandapalli under jQuery category on | Points: 40 | Views : 424
$('#' + id).html('<a href=&quot;http://www.dotnetfunda.com&quot;>http://www.dotnetfunda.com</a>');
$('#' + id + ' a').live('click', function (e) {
e.preventDefault();
$('#' + id).html('Prevented going to http://www.dotnetfunda.com and displayed this message instead.');
});

Comments or Responses

Login to post response