2012-04-24 26 views
1

RSS投稿フォームを作成しましたが、入力ボックスにEnter your email here....のようなものを表示したいときは、そのメッセージをクリックするとメッセージが消えてボックスにメールを入れることができます。ここで投稿フォームの値

は、私はそれを行うことができます問題は、誰かがそれをクリックしたときに、それは消えていないことである、と私は私の検索フォームを含む多くの形態を見た瞬間

<div id="RSS"> 
     <form action="http://feedburner.google.com/fb/a/mailverify" class="RSS" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=RSS', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"> 
      <input type="hidden" name="uri" value="RSS"> 
      <input type="hidden" name="loc" value="en_US"> 
      <input name="email" id="RSS-text" type="text" maxlength="100" style="width:160px !important" value="Enter your email address..." class=""><button type="submit" id="RSS-button">Subscribe</button> 
     </form> 
    </div> 

で使用しているコードです。そうですね。

答えて

2

プレースホルダの属性を使用することができますが、それはIEをサポートしていません:

<input type="text" placeholder="Enter your text here..." /> 

そうでなければあなたはjavascriptのビットを使用することができます。

<input type="text" onfocus="if(this.value=='Enter your text here...') this.value='';" onblur="if(this.value=='') this.value='Enter your text here...';" value="Enter your text here..." /> 
+0

はありがとうございました! – Ali