Solved

Change Css Class atribute in code

Posted on 2013-05-25
2
195 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Use javascript to open specific place on an accordian in other page 8 39
Can't get page to reload 9 18
href return to normal window 5 28
How Close unsubmited attempts 10 42
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
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…

685 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