我有带有背景图像的文本框。每当我单击文本框时,背景图像应该会消失,并且只有文本应该可见。当文本被清除后,bg 图像应该会再次出现。这怎么可能 ?
<asp:TextBox runat="server" Width="160px" ID="txt_google_search" style="padding: 6px; background: url('http://www.google.com/cse/intl/en/images/google_custom_search_watermark.gif') no-repeat scroll left center rgb(255, 255, 255);" ></asp:TextBox>
我在我的代码隐藏中尝试了以下内容,但它不起作用。
txt_google_search.Attributes.Add("onclick", "me.style.backgroundImage = none;")