Tutorial :Javascript variable passing



Question:

Can anyone help me with my project? How will I be able to call the textfield details in javascript?

function AddPushpin()  {      var shape = new VEShape(VEShapeType.Pushpin, map.GetCenter());      shape.SetTitle(**//it should be coming from a textfield//**);      shape.SetDescription('This is shape number '+pinid);      pinid++;      map.AddShape(shape);  }  


Solution:1

document.getElementById('myTextElementsId').value


Solution:2

<textfield id="shapeTitle"></textfield>    ---- // -----    document.getElementById('shapeTitle').value  

where 'shapeTitle' should correspond to the ID of the element you need the value of.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »