ワーキングデモ http://jsfiddle.net/Zvd8J/
Jquery.on
イベントの詳細については、こちらを参照してください。ただし、v 1.7 以降のみです: http://api.jquery.com/on/ .live
ここ: http://api.jquery.com/live/
熱心なら: jQuery .live() と .on() の違いは何ですか
さらに熱心になったら、こちらの理由を参照してください: jQuery live メソッドの何が問題なのですか?
小さなhtmlとデモを自由に書き留めてください。
お役に立てれば、:)
また、注意してください:これを行うことができます:
$(document).on('click','#create-account-btn',function(){
});
コード
$('.hulk').hide();
$('#create-account-btn').on('click',function(){
$('.hulk').hide();
$('#create-account').show();
});
$('#foo').on('click',function(){
$('.hulk').hide();
$('#create-whatever').show();
});
html
<div class="hulk" id="create-whatever">
hulk yada yada
</div>
<div class="hulk" id="create-account">
ironman yada yada crea accoutn show
</div>
<input type="button" id="create-account-btn" value="click me" />
<input type="button" id="foo" value="click me to show another" />