开发者

Basic element class swap, not showing correct alert message, using JQuery?

I have this code I'm working on, see link:

http://jsfiddle.net/PqsAD/3/

The problem is depending o开发者_开发问答n a elements class name (.no-submit or .btn) the click function should show a different alert message. Although this isnt working. Clearly I have missed something.

Would really appreciate it, if someone could help me shed some light on the matter. Thanks


Change your handlers in that way:

$('.no-submit').live('click', function(){ 
    alert('The form has NOT been submitted!');
});    

$('.btn').live('click', function(){ 
    //$(this).parent().find('form').submit();
    alert('The form has been submitted!');
});  

fiddle: http://jsfiddle.net/PqsAD/5/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜