![]() |
Jquery: Selecting all with a certain class
Hey, is it possible to select all the elements with a class containing the text "lm". So, stuff can have the class lm2 or lm9 and those objects will be selected?
I tried: Code:
$("e.attr('class'):contains('lm')") |
|
Thanks, I forgot about that.
Now, is there anyway to select the name of a class that contains "lm"? I can do it using jquery to select all the classes of something that has "lm#z" as one of them. However, I have to use string manipulation to get the class name that starts with lm and ends with z Code:
var all_classes = $(e).parents(".div_row[class*='lm']").attr("class"); |
You can use CSS to do that:
Code:
<style> |
Quote:
Using js is likely to be the most widely supported approach. |
Second most popular browser would be IE7, and it supports it. If you thinking about IE6, possibly it doesn't. I don't know, I don't use IE6 for testing and pages I make are not available for users of IE6 and lower. The sooner IE6 dies out, the better for all of us :)
|
Quote:
W3Schools will tell you 20%, whilst thecounter will tell you 35% IE6 has 20%+ of the (non-niche) market, which is more than enough to warrant support by any site wishing to reach users. Not insignificantly, Yahoo still consider IE6 a browser worthy of A-Grade support - which, one presumes, is based on their own stats which are likely to give a good picture of the general browser share situation. Quote:
It doesn't support attribute selectors. Now you do know. Quote:
If so, are they happy that their sites 'are not available' to around 20%+ of (general) users? |
I don't make websites for money. Paid developer probably couldn't [unless asked to] make a website inaccessible to IE6 users on purpose. By 'not available' in my previous post I meant - if you visit it with IE6 or lower, only thing you get is an advice to upgrade your browser. Without going another mile off topic, if you wish to know my reasons for having 20% less visitors, feel free to PM me.
P.S. Linked sites are not mine, just show what I agree with. |
Quote:
I, on the other hand, do - which means, for better or worse, I need to put what my clients' aims ahead of desires to make my life that little bit easier (though I get paid for the time I spend fixing things in IE6 as well, so…) (I've not had major problems bringing IE6 into line for some years. I may not end up with identical sites, effects, full features for IE6, but I sure as hell don't give them a page telling them to upgrade. The key is progressive enhancement, not to fob off that many users with an upgrade notice.) Don't get me wrong. I'm as in love with web standards and resentful of IE6 as the next standardista. There are few things I'd like more (for my working day) than to see IE6 suddenly disappear from face of the earth. But, back in the real world, where ditching ~20-35% could literally mean losing out on millions in revenue for clients, my desire to ignore IE6 users isn't likely to find parity amongst my clients. Consequently, it's most often those with few, if any, clients who enjoy the luxury of drawing lines in the sand, saying that they don't and won't support IE6. Professionals are too busy just getting on with it. |
Lol @ this thread. Part of the fun in development is finding ways to make your design appear exactly the same on everybody's screen (whether that means browser, resolution, flash, whatever).
Without that challenge I'd be bored out of my mind. |
| All times are GMT +1. The time now is 03:58 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.