Posted By

Barlon on 11/13/11


dialog prevent

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Prevent default behaviour

 / Published in: JavaScript

Stop default behaviour from happening. In the second example we open a jQuery UI dialog instead of going to a different url when clicking on an A-tag with an id of "myLink".

  1. function(evt) {
  2. evt.preventDefault();
  3. };
  5. $('#myLink').click(function(evt){
  6. evt.preventDefault();
  7. $('#myLink').dialog('open');
  8. });

Report this snippet  

You need to login to post a comment.