只需关闭第一个外部脚本包含并启动另一个为我工作的脚本标记。
<html>
<head>
<title>City Finder</title>
<script src="http://code.jquery.com/jquery-3.2.1.min.js"></script>
<script>
$(document).ready(function(){
$("#cityField").keyup(function()
{
alert("This works");
});
});
</script>
</head>
<body>
<form>
Enter A Utah City: <input type = "text" id="cityField" value= ""><br>
Suggestion: <span id="txtHint">Empty</span>
<input id="weatherButton" type ="submit" value="Submit">
</form>
<p>City</p>
<textarea id = "displayCity">No City</textarea>
<p>Current Weather</p>
<div id="weather">No Weather</div>
<input type = "button" onclick = alert("hello"); name = "ok" value = "Climb out window">
</html>