Passing a Javascript Variable

Can someone help me with my project? How can I call textbox 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);
}
+3
source share
2 answers

document.getElementById ('myTextElementsId'). Value

+4
source
<textfield id="shapeTitle"></textfield>

---- // -----

document.getElementById('shapeTitle').value

where 'shapeTitle' must match the identifier of the element that needs a value.

+3
source

Source: https://habr.com/ru/post/1706514/


All Articles