I need to pass numerical arguments to a onclick function in javascript

I need to pass numerical arguments to a onclick function inside anchor tag in javascript.I wrote the code as follows but its not working.

var lat1=latitude;
var lon1=longtitude;

u.append('<a data-role="button" id="direction" onclick="showDirection(lat1,lon1)" >View directions</a>');


Source: javascript

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.