JSFiddle - React, Tailwind, and code Playground
HTML
<input id="googleMapCity"></input>
<span id="AddGoogleMap">click me</span>
JavaScript
$("#AddGoogleMap").click(function () {
if($('#googleMapCity').val() === "") {
alert("You need to fill out a city");
} else {
// do something
}
});