Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery find by inline css attribute

Tags:

I need to find an element based on a specific css attribute. The css is applied inline and I can not use a class. Is there anyway to achieve this in jQuery?

like image 746
dev9 Avatar asked Jul 24 '09 20:07

dev9


People also ask

How to check CSS value in jQuery?

click(function(){ if($(this). css("background-color") == "#FFFFFF") { $(this). css("background-color", "#C2DAEF"); } });

How do I get inline CSS?

CSS can be added to HTML documents in 3 ways: Inline - by using the style attribute inside HTML elements. Internal - by using a <style> element in the <head> section. External - by using a <link> element to link to an external CSS file.

What is the use of CSS () method in jQuery?

jQuery css() Method The css() method sets or returns one or more style properties for the selected elements. When used to return properties: This method returns the specified CSS property value of the FIRST matched element.

Which method is used to access CSS properties?

jQuery css() Method The css() method sets or returns one or more style properties for the selected elements.


1 Answers

You could use an attribute selector

For example

$(":radio [style*='regular']") 

would return a wrapped set of any input radios that contain 'regular' in the style attribute

like image 122
Russ Cam Avatar answered Oct 12 '22 23:10

Russ Cam