2017-03-04 3 views
0

に取り組んでいない:クリックjqueryの呼び出しは、私は次のように簡単なコードを記述しようとしていますボタンのクリック

<html> 
    <head> 
     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" /> 
    <script> 
     $("#submitQuery").click(function() { 
      alert("Hola!!"); 
     }); 
    </script> 
    </head> 
    <body> 
     <label for="geo_location"> Enter location here: </label> 
     <input id="geo_location" type="text" name="geo_location" required /> 
     <button id="submitQuery">Find out</button> 
     <div id="test"></div> 
    </body> 
</html> 

をしかし、何もしない]ボタンをクリックします。どこが間違っていますか?

答えて

3
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" /> </script> 
<script> 
    $(function(){ 
     $("#submitQuery").click(function() { 
      alert("Hola!"); 
     }); 
    }); 
</script> 

..

あなたはレディ機能を欠場...これを試してみてください
関連する問題