Solved

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

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

860 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