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
      Did you know?Explore Trending and Topic pages for more stories 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

SQL query not working well
Hi,
I made a small table with 5 rows and want to make them an sql consult using rownum

Reading waves
Hi,

I am trying to find a way of finding the highs and lows on a graph line, the line points

Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing

Deleting Partners on the Customer Master.
Does SAP handle removing the Partner from Open Sales Orders when a Partner is deleted in the Custome

using variables in another page
I have a test database set up on localhost. I have a form that I can type a name into, hit the butto

Accessing Infotype data in dialog program
Hi All
In Dialog programs attributes I didn't see any logical database field. How can I access

rdns with php
I am trying to build a script that will show all of the different domains that are hosted on the sam

PHP error (line 38) my website
Hello everyone, I'm new on this
and I got a web site thats got a error not showing the photos on<

form submit at godaddy?
Trying to test form submission at GoDaddy and it does not seem to work. Here's the page...

h

Greek characters in php
Hi,

I'm making a script and I m using for first time greek characters.
I started to write

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