Schleid Alex

Schleid Alex

  • NA
  • 361
  • 44k

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

Answers (4)