Schleid Alex

Schleid Alex

  • 1.7k
  • 284
  • 6.9k

Calling function in external js file from html hyperlink

Sep 28 2020 6:25 PM
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

Brought to you by:

Answers (4)