javascript - how to get the value of an input and put it into an onclick -
I have this problem, there was a function on AJAX which needs latitude and LNG variables, so that the function test (latitude, LNG) . ..
This HTML is a simple code:
& lt; Fieldet & gt; & Lt; Legend & gt; Servise de geocodifixio & lieutenant; / Legend & gt; Latitude: & lt; Br> & Lt; Input type = "text" id = "lat" value = "42.3600077" /> gt; & Lt; Br> Longitude: & lt; Br> & Lt; Input type = "text" id = "lng" value = "1.4579696" /> gt; & Lt; Br> & Lt; Input type = "button" value = "veer dades" onclic = primer () /> & Lt; Input type = "button" value = "weir coordinate" / & gt; & Lt; Br> Carrier: & lt; Br> & Lt; Input type = "text" id = "car" /> & Lt; Br> Ciutat: & lt; Br> & Lt; Input type = "article" id = "ciu" /> gt; & Lt; Br> Money: & lt; Br> & Lt; Input type = "text" id = "pai" /> & Lt; Br> CP: & lt; Br> & Lt; Input type = "article" id = "cod" /> & Lt; Br> & Lt; / Fieldset & gt; Therefore, problems remain onclick, how can I get the value of ID latitude and LAG? And put it in the onclick function?
onclick = primer selection (id lat.value, id lng.value) Can anyone please help me?
I will not use onclick , but use an event listener At any rate, you can use onclick = "primer selection (document.getElementById ('lat'). Value, document.getElementById ( 'Lng'). Value) "
Comments
Post a Comment