Skip to content

24 ways to impress your friends

Vote down?

Dustin Diaz

Although I haven’t found a terrible big use for attribute selectors, I have ran into the problem quite a bit of styling form input elements correctly and that’s when they would really come in most handy. Since there are so many kinds of ‘input’ elements, it would be nice to narrow it down by input[type='text'] { } or input[type='submit']

Instead with the little help of JavaScript I have it just append the type it is as a className to itself…this way we could, at the least, do this:

input.text { }

input.submit { }

Anyway, yey for the ad-free tips :) That’s too cool.