本ブログの検索窓(画面右上)のように、カーソルを合わせると文字が消えるフォームは最近よく見かける。jQueryを使ってこのフォームを作るにはどうしたらいいか。基本テクニックと応用テクニックを紹介しておこう。 サンプルとして紹介するHTMLの基本構造はこんな感じ。 <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery.js"></script> <script type="text/javascript"> $(function() { // Implement later... }); </script> <style type="text/css"> input#sample { width:200px; padding:2px; } input.dummy_text { color
![カーソルを合わせると文字が消えるフォーム | Inhale n' Exhale](https://cdn-ak-scissors.b.st-hatena.com/image/square/ac941106c2e7cf31619faa6f42f68c163907e083/height=288;version=1;width=512/https%3A%2F%2Fh2plus.biz%2Fhiromitsu%2Fwp-content%2Ffbogp.png)