简体   繁体   中英

jQuery alert not working

can anybody see where im going wrong here? Im trying to make a simple alert function when a button is clicked.

http://jsfiddle.net/jG9SQ/


Okay so its working in jsFiddle but not on my website that HAS jQuery running:S

I have the following php...

    if($interest1 != ''){
        print $interest1 . "<a href='javascript:void(0);' class='deleteinterest'>delete</a><br />";
    }

and in my AJAX.JS I have the following...

// Delete Interest Function
$(".deleteinterest").click(function()
{        

   alert('hello');
});
// End Delete Interest Function

Only this doesnt work?

You have mootools selected, try using jquery selection in the jsfiddle menu.

Fixed it for you: http://jsfiddle.net/jG9SQ/1/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM