javascript - Change the value of a variable after it's been set -
here's problem.
i have piece of code sets user location coordinates in textbox.
var initiallocation; $('#from').val(initiallocation);
the initiallocation variable gets user current location coordinates , $('#from').val(initiallocation);
puts coordinates in textbox "from".
but instead of boring coordinates "45.542307, -73.567200" i'd textbox show "your location".
so basically, want have coordinates in textbox, change user sees "45.542307, -73.567200" "your location".
is possible such thing ?
thanks !
you can use data method of jquery stores data specific element
$("#from").data("currentlocation", initiallocation).val("your location"); //to retrieve currentlocation $("#from").data("currentlocation");
Comments
Post a Comment