title: Why is event.preventDefault(); not working here?
body: <p>The browser URL is not supposed to be altered but it is anyway. That is supposed to be prevented by event.preventDefault() in the event listener for the cityNameSubmit button.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;script&gt;
      function bindButton() {
        document.getElementById('cityNameSubmit').addEventListener('click', function (event) {
          event.preventDefault();
        })
      }
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;form&gt;
        &lt;fieldset&gt;
          &lt;legend&gt;Choose a City&lt;/legend&gt;
          &lt;input type="text" name="cityName" id="cityName"&gt;
          &lt;input type="submit" id="cityNameSubmit"&gt;
        &lt;/fieldset&gt;
      &lt;/form&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>