社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Bee  »  全部回复
回复总数  1
6 年前
回复了 Bee 创建的主题 » jquery keyup未引发警报

只需关闭第一个外部脚本包含并启动另一个为我工作的脚本标记。

<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>