4
Answers

Calling function in external js file from html hyperlink

Schleid Alex

Schleid Alex

4y
707
1
Hi everyone
I have this situation where data pulled from a database and I have to turn one of the column into hyperlink to call a jquery function that is located on an external js file. here is my hyperlink
<a href ="#" onclick="details(@item.productid);">link text</a>
 my function is like this
 
$(document).ready({
 function details(id)
{
alert("you clicked me")
}
}); 
Unfortunately when the link is clicked nothing happened, could someone help me please?
 
Thanks a lot
Answers (4)