change text color with a jQuery code


Posted on 16th Feb 2014 07:03 pm by admin

Hihow can I change the text in a asp:TextBox to a different color when I start typing using jQuery?I have this htmlview plaincopy to clipboardprint?
  1. Required.
    1. Required.

    2. and in a css file I have
      view plaincopy to clipboardprint?.text{color:Gray;} .text{color:Gray;}
      but when I type, I want the color to change to black instead of gray. the reason whey is because the Text attribute is being initially used as the box lable "Name:" in gray, and once I give it focus, it disappears.in a js file like this
      Did you know?Explore Trending and Topic pages for more stories like this.
      view plaincopy to clipboardprint?var $a = $("input[id$=name]"); $a.focus(function(event) { if ($a.val() == "Name:") { $a.val(""); } }); $a.blur(function(event) { if ($a.val() == "") { $a.val("Name:"); } }); var $a = $("input[id$=name]"); $a.focus(function(event) { if ($a.val() == "Name:") { $a.val(""); } }); $a.blur(function(event) { if ($a.val() == "") { $a.val("Name:"); } }); I tried the following which did not fix it.view plaincopy to clipboardprint?$("input").animate ({ color: "black" }); $("input").animate ({ color: "black" });
      thanks
No comments posted yet

Your Answer:

Login to answer
126 Like 19 Dislike
Previous forums Next forums
Other forums

Displaying values from a SQL count...
Hi,
Easy enough question i just forget the exact method ..
I have ...

Code: //count win

Problem writing URL into database
How would I write this into the database?

<?php echo "http://".$_SERVER['SER

Bandwidth monitoring?
Hi guys,

I need a little information I have written a php app and I occurred to that I need

Force download script not handling files with spaces properly
I have a regular old php force download script, uses this code:

Code: header("Cache-Cont

Alterar a hora do servidor
Se alguém souber, ajude-me a adicionar 6 horas, obrigado
<tr>
&

CHECK A STRING FOR ' " ' (DOUBLE QUOTES)
I am checking for delimiter (.!?) and if there is a " after a sentence then it should neglect a

how to easy edit text, with box? Help.
Hi.
I have a little problem. I'm doing a webpage for my aunt and I would like to make it as easy

Problem with umlauts and UTF-8
Hello every1,

I'm creating my own little CMS at the moment and got some problems with the cha

Unable to display contents in Second Drop Down Box
Hi All,

What I am trying to do is 2 dependent drop down boxes and when user selects su

IIS7 and getimagesize() problem
I have just discovered after hrs of trying to fix a problem where it's coming from. It's to do with

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash