I think this may be my most embarrassing question to date.
Why does this not work? Ive been staring at this for around half an hour now and im starting to get desperate
My HTML
<a class="closedialog" href="#">Close</a>
My JavaScript
$(document).ready(function() {
$("a.closedialog").click(function() {
alert("Test")
});
});
You forgot to add the jQuery library, at the left panel.
This fiddle does work: http://jsfiddle.net/FU6Jb/1/
More explanation on JSFiddle. The dropdown box above the Framework indicates where the code should be inserted. Using your current setup, your JavaScript code will be wrapped in a onload event. I recommend to use the
nowrap (head)option.