Solved

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

Posted on 2012-03-22
2
275 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
align Linkedin sign to the right page 5 36
Bottom border change 5 15
Why doesn't Google directions work? 6 46
If condition on Html with Asp 11 17
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

777 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