Result
jQuery
$(document).ready(function() {
//キーボードイベント
$("#input").keyup(function() {
//id="input"に入力した内容がid="out"に反映される
$("#out").html($(this).val());
});
//クリックイベント
$("#show").click(function() {
//反映箇所の表示/非表示スイッチ
$("#out").toggle();
return false;
});
});
css
/*非表示にしておく*/
#out{display:none;padding:1px;border:1px solid #666;width:152px;}
html
<input type="password" id="input"> <a id="show">show</a> <p id="out"></p>
[myphp file=’jquery-other-snippets’]
