<input type="text" id="my_input">
<button onClick="getCoordinates()">Get Coordinates</button>
<pre id="my_pre"></pre>
govmap.setToken("...");

function getCoordinates() {
  const address = document.getElementById("my_input").value;
  govmap
    .geocode({
      keyword: address,
      type: govmap.geocodeType.AccuracyOnly
    })
    .then(
      (response) =>
        (document.getElementById("my_pre").textContent = JSON.stringify(
          response,
          null,
          2
        ))
    )
    .fail(
      (res) =>
        (document.getElementById("my_pre").textContent = JSON.stringify(
          res.responseJSON,
          null,
          2
        ))
    );
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://code.jquery.com/jquery-1.12.1.min.js
  2. https://www.govmap.gov.il/govmap/api/govmap.api.js