tags:

views:

382

answers:

3

for example:

.Title {

color:red; rounded:true;

}

.Caption { color:black; rounded:true; }

how to select by property named "rounded"?

css class name very flexible.

$(".Title").corner();
 $(".Caption").corner();

How to replace this 2 operation to one operation. Maybe like this:

$(".*->rounded").corner();

this seems stupid to me. How to do this? is it possible?

A: 

Use the following code $(".Title ") returns the elements with that class.

More Info http://docs.jquery.com/Selectors/class#class

RC1140
The question is about assigned CSS properties, not HTML class names.
David Dorward
A: 

Hope this work:

jQuery('.Title[~rounded]')
Ramiz Uddin
if class name changed this work fine?
ebattulga
That is just a syntax error.
David Dorward
+8  A: 

You cannot (using a CSS selector) select elements based on the CSS properties that have been applied to them.

If you want to do this manually, you could select every element in the document, loop over them, and check the computed value of the property you are interested in (this would probably only work with real CSS properties though, not made up ones such as rounded). It would also would be slow.

Update in response to edits — group selectors:

$(".Title, .Caption").corner();
David Dorward
+1 for the only answer so far addressing the question :-)
Boldewyn