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

      Production Order Enterprise Service to Manufacturing Exctn Sys (MES) ???
      Hello Experts,

      In our current landscape SAP ECC 5.0 is integrated to MES system via PI 7.

      Gerenate tabel in Php
      I whant to generate a tabel takeing data from database like this one so the results to be display on

      Needing Youtube thumb nail fix.
      I have a script on a site that pulls in you-tube videos,
      The problem is, that the thumb nails for

      Problem with an browser game.
      Hello,i just joined that great forum and i got php prob,its kinda freaky...anyway i got browser game

      Email logic not working
      I would like to send an email using the php email() function then if it does execute i.e sends i wou

      Solution Manager BPR
      Does the SolMan-BPR-ARIS-Integration (http://www.ids-scheer.com/en/ARIS/ARIS_Platform/ARIS_Business_

      PDO returns erroneous columns from within pdt
      Hi All,

      This is a truly weird behavior:
      When using a simple pdo fetch, erroneous columns a

      Dynamic memory problem
      Hey,

      At the beginning of my code, I have this line:

      Shape* gShape = 0;

      Conditions of info record - Error
      When i created GR (901) and PO create automatic my PBXX is obtain the net price of info record but

      Mail form doesn't send Russian/Cyrillic characters correctly?
      When someone enters foreign characters (like Cyrillic text, and Japanese/Chinese probably gives the

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