Solved

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

Posted on 2012-03-22
2
273 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
Comment Utility
Try adding "!important" to your redClass:

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

Open in new window

0
 

Author Closing Comment

by:shampouya
Comment Utility
That worked, thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
This article discusses four methods for overlaying images in a container on a web page
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 the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

744 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

9 Experts available now in Live!

Get 1:1 Help Now