Topic: How do I pass a variable to this js???
So here is my code that I have so far. It doesn't work... :
function gmap_update_position(model){
lat = document.getElementById($(model)+"lat");
lon = document.getElementById($(model)+"lon");
lat.value = ""+ marker.getPoint().lat();
lon.value = ""+ marker.getPoint().lng();
}I want to pass the 'model' variable to the 'getElementById'. It should read: getElementById("model_lat");
However replacing the model with whatever the variable is.
I am useless at Js, any help would be greatly appreciated!