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

      downloading a file as HTML
      Hi.
      I'm rather confused with forcing a download. I just want to save dynamic content (from $_SESS

      PHP error on MySQL insert
      I'm sure it's the simplest of issues, but I can't recall why this isn't working.

      Code: [Selec

      ereg_replace in Wordpress
      Heya - so I'm working on this site: http://world-of-smiles.theportlandco.com/new-patients

      The

      ORA-00932: inconsistent datatypes: expected - got CLOB
      SO : windows xp
      database : XE

      there is a table (transito) with two fields of clob

      Sales orders ans reservations not taken into account on MPS / MRP
      Hello,

      I am implementing the MPS / MRP and I have the following problem:

      I ha

      quotes changing
      hi all

      in my content

      opening quotes " changes to “

      close qu

      Can we convert non uni code system into unicode
      Hi All,

      Presently i am using non-unicode system and the sap version is 4.7.
      Can i c

      Quick Syntax Question
      Hi folks,

      I'm getting the following error: "unexpected T_LNUMBER". I'm trying to b

      reating a background image
      I am building a site in drupal and have a php form in it, due to certain annoyances with module buil

      Modal Popup Help
      Hi guys, I have a modal popup with an iframe. How can i send data from a label or textbox to the ifr

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