Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
83
rated 0 times [  89] [ 6]  / answers: 1 / hits: 35536  / 14 Years ago, sat, november 27, 2010, 12:00:00

How to select with a specific style attribute?



<div style=width: 420px; text-align: left; margin-top: 10px; margin-bottom: 10px;>


I'm trying:



$(div[style='width: 420px; text-align: left; margin-top: 10px; margin-bottom: 10px;']);  


but nothing gets selected.


More From » jquery

 Answers
8

Your example works for me, in Chrome at least, once I corrected the typo of the missing at the end of the line.



$(div[style='width: 420px; text-align: left; margin-top: 10px; margin-bottom: 10px;']);


See this demo.


[#94824] Thursday, November 25, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
dajah

Total Points: 208
Total Questions: 97
Total Answers: 87

Location: Falkland Islands
Member since Mon, Jul 13, 2020
4 Years ago
;