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

      cURL Sending File as Post
      This is a bit complicated, I'm just hoping someone else has run into this and knows how to do it a d

      Is there a function ... auto send IP
      Is there some function that can be sent to a ddns service that returns the ip address of a ddns forw

      Transaction variant for VA02 not working
      My requirement is to have transaction for user to only add the output and print a sales order.

      Estimations and Effort
      HI Gurus,

      Would like to know whether SAP have a provision for carrying out the Project es

      PHP File Upload Problem
      Hi, I have written a very simple file upload script but it fails for reasons I can't explain. Hope

      Batch Session SM35 stuck in status 'in Background
      Hi Experts,

      I am facing a problem with Batch Input session SM35.

      The batch se

      The repetition structure: the while statement not working
      New programming student, have assignment as follows:
      A restaurant has 4 lunch combos for custom

      Rounding a number queried from a database
      I know that to display a rounded number you just do echo "round($number)";. But how would

      include problem
      I have my root folder as:
      Code: $root = $_SERVER["SITE_HTMLROOT"]; // the server root<

      Date/Time and Checkbox
      Hi Everyone,

      I am trying to figure out how to insert the current date and tim

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