6👍
✅
If you’re using plain javascript (not jQuery or any frameworks) you can access the field by document.getElementById('id_distance').value
. You can set it’s value by document.getElementById('id_distance').value = <some_var>;
Source:stackexchange.com