我正在测试
keyup()
通过在文本字段中键入时发送警报,但不会发生任何情况。不知道我是否需要做单独的括号,或者如果我没有包括一个库。
<html>
<head>
<title>City Finder</title>
<script
src="http://code.jquery.com/jquery-3.2.1.min.js">
$(document).ready(function()
{
$( "#cityField" ).keyup(function()
{
window.alert("Handler for .keyup() called.");
});
});
</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>