input: def submitForm(event):
    """
    A function in JavaScript that prevents form submission, captures the city entered by the user, and sends the details to the server using a POST request.
    
    :param event: The event object representing the form submission.
    :return: None
    
    Example:
    If the user enters "New York" as the city and submits the form, the function will send a POST request to '/my-api/submit-form' with the following JSON body:
    {
      "city": "New York"
    }
    """
output:     event.preventDefault();
      const city = document.getElementById('cityInput').value;
      fetch('/my-api/submit-form', {
          method: 'POST',
          headers: {
              'Content-Type': 'application/json'
          },
          body: JSON.stringify({ city })
      })
      .then(response => response.json())
      .then(data => {
          console.log('Success:', data);
      })
      .catch((error) => {
          console.error('Error:', error);
      });