calling jquery file on anchor click
Hi,
I have the following HTML anchor tag and I want it to call my JQuery script when it is clicked :
<
a
class
="screenshot-link"
id
="dv1"
siteno
="dv_1"
href
="#">
1
</
a
>
However, it seems to call the script on page load, and not when it is clicked. Here is my JQuery :
$(
".screenshot-link").click(function () { var siteno = $(this).attr("siteno"); $.post(
"/Development/Main/ShowImage", { siteno : siteno}
);
});
Can anybody please help?