Py学习  »  Jquery

jquery keyup未引发警报

Madison Brann • 5 年前 • 1850 次点击  

我正在测试 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>
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/39166
 
1850 次点击  
文章 [ 2 ]  |  最新文章 5 年前