javascript - jQuery class selector and click() -
i'm trying alert happen when clicked. can working in jsfiddle, not in production code: jsfiddle example works (jquery 1.5 loaded) html (in case jsfiddle inaccessible): <!doctype html><html><head><title>test</title></head> <body> <h1>25 feb 2011</h1><h3>abc</h3><ul> <li class="todoitem">test—5 minutes</li> </ul> </body></html> javascript: $(".todoitem").click(function() { alert('item selected'); }); non-working production example: <!doctype html><html><head><title>test</title> <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(".todoitem").click(function() { alert('item selected'); }); </script> </hea...