I have a variable callled "myLocation".
I would like to take the value from my text box and feed it into "lat1" which is inside the variable "myLocation".
I have tried using the jQuery $().attr('value')
function but it does not seem to work.
Any suggestions?
Here is my code:
<input type="text" id="input1">
$(document).ready(function () {
$('#input1').keypress(function(event) {
if (event.which == 13) {
element1 = $('#input1').attr('value');
var myLocation = {
lat1: 2, // I wold like to feed data here from the textbox
// I tried element1 = $('#input1').attr('value'); but it does
not seem to work
lng2: -56
};
};
});
});