I have this jquery code:
$('.viewmap').click(function () {
updateMap();
});
So when someone clicks a link with the viewmap class it runs a function called updateMap. In the updateMap function I create a variable like so:
var mapid = $(this).attr('title');
The variable above does not work, it has a undefined value, my question is in the viewmap click function how do I access the current data via $(this) in the updateMap function?
pass a reference of
this
to the updateMap function