Solved

Change Css Class atribute in code

Posted on 2013-05-25
2
190 Views
Last Modified: 2013-06-15
if you have a class in a style section <style></style>, and this class is going to be assigned to various objects, is there a way to change the class 'before' it gets assigned,
i.e. NOT elementsWithClass.classAtribute='newVal'; //the usual, elements already have class,
but class.classAtribute="newVal";//so now, any new elements assigned the class will already have the newVal atribute.
0
Comment
Question by:Silas2
2 Comments
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 200 total points
ID: 39197171
When you want to add value? You can do it using jQuery but you will need some condition like clickevent or load or somethings.
<script>
$(document).ready(function(){
$('.classname').css("classAtribute","value");
});
</script>

Open in new window

0
 

Author Comment

by:Silas2
ID: 39210401
Let me just try that...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

707 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

16 Experts available now in Live!

Get 1:1 Help Now