私は、このHTMLjQuery入力と機能をクリックしますか?
<div class="someclass">
<input id="special" type="submit" value="Post"/>
</div>
持っていると私はjQueryのクリックして、機能を実行するために実行できる方法として混乱していますか?すなわち、これは動作します
<div class="someclass">
<input id="special" type="submit" value="Post" onclick="specialFunction();"/>
</div>
しかし、これはありませんか?
jQuery('#special').click(function() {
specialFunction();
});
おそらくあなたは 'ready'イベントハンドラ内でそのコードを入れていなかったので。それは動作します:http://jsfiddle.net/fkling/E8nhw/私はあなたがチュートリアルを読むことをお勧めします:http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery –