I have several links on my page and each one contains a different id=X. I want to open a dialog box when user clicks on any of these links and also want the id value of the link that was clicked. Using this ID I need to go back to my server and fetch a page into the dialog box using ajax.
My first step was to try to get the ID into the dialog box. So, I created a sample: http://jsbin.com/ajefel/1/
The dialog box opens up, however, I don’t know how to get access to the id value of the clicked link into the dialog box.
Question
In the example above, how can I include the value of the clicked link inside the dialog box?
Pass reference to sender to your function:
Modify the function to accept sender as parameter:
PS: Avoid inline javascript when possible..
See your modified JSBIN.