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
      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

      OPINIONS WANTED
      This is my login page code, and I want your opinion on it please!

      Code: // Login ~ CHECKS

      Date help - fetch dates for Mondays between xxx and yyy?
      Does anyone know the best way to do this? I have two dates, say:

      2010-01-26 and 2010-05-30

      Need help: how to catch acess of undefined class properties
      Hello. I am learning OO with PHP and have hit a problem.
      Some code runs as perfectly valid code,

      Upload file!
      Ok i have a form..
      Code: <form name="form1" method="post" action=&quo

      unexpected T_SL without a shift left token
      Nothing too see here, I'm an idiot and resolved the problem.

      Prevent PHP mail( ) from appending hostname to from address
      Hey guys,

      I want to be able to send texts to phones via email (since each phone has their own

      Reg Ex
      Im trying to search for the string: srv_9 (Dead ???)

      I thought to use preg_match, however I d

      Simple PHP/Java Help..
      Hi,
      I'm trying to build a little program to do with calculating postage. Unfortunately i haven't

      utl_file open error
      i have file in the unix path

      Path /popdev01/pop/popdevb/tfi/

      File name

      Images outside webroot
      Im hopeing someone can help me with this because i cant figure it out.I have setup an ASP.NET websit

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