Im trying to assign a value for my ion-input element via JS. here is my code:
HTML:
<ion-input type="text" placeholder=" Enter a location" style="padding-left: 10px;" id="geolocation"></ion-input>
JAVASCRIPT:
function onSuccess(position) {
var element = document.getElementById('geolocation').value = position.coords.latitude + ',' + position.coords.longitude;
//element.value = position.coords.latitude + ',' + position.coords.longitude + element.value;
}
I cannot change the value of my input element, I want to put the position.coords.latitude + ',' + position.coords.longitude as the value of my input element.
Hoping for a quick answer. Thanks!