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

      When i am Canseling the Billing Document in VF11 I am getting Shortdump
      Hi Experts

      When i am Canseling the Billing Document in VF11 I am getting Shortdump.

      Mail from PHP form not always ending up in my inbox?
      Hi guys,

      I'm a real newbie to PHP and have managed to put together a simple mail form that se

      Adding Different Numbers From MySQL
      Basically I have a mysql database with a couple prices as the following:

      9.99
      9.99
      9.99

      PHP Session Issue
      I'm having an issue with one section on my website dealing with sessions. Now I know that myself and

      problems with contact forms that are only protected against SQL injections
      What could be a potential problem with contact forms that are only protected against SQL injections

      question about stripslashes and real_escape_string
      im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.

      I hav

      Warning: mysql_num_rows() expects parameter 1
      When i add quote at the end of this link
      example:http://localhost/articlemania/category.php?cid=3

      urldecode question
      How would I format this line of code properly?

      <?php echo urldecode($_GET['Title']); ?

      is_dir() problem
      Hello,

      I'm buidling a php scripts that dynamically get's subfolders from a specific folder.

      help with multi-update
      Now sure how to ask this really....
      10g database if that matters.

      I have a customer

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