Solved

Why am I not able to add a class here using jquery?

Posted on 2012-03-22
2
274 Views
Last Modified: 2012-03-22
In line 44 of my page5.js code, I try to change the background color of an input field using this jquery statement, but it's not working. Any idea why? (I included my site link below too)

$("#firstName").addClass("redClass");

my webpage
0
Comment
Question by:shampouya
2 Comments
 
LVL 15

Accepted Solution

by:
StingRaY earned 500 total points
ID: 37755854
Try adding "!important" to your redClass:

input.redClass{
	background-color:#FFFFFF !important;}

Open in new window

0
 

Author Closing Comment

by:shampouya
ID: 37755893
That worked, thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now