How To : Grab CSS Selectors on a click Using jQuery


Writing HTML is itself a challenge for developers and writing correct CSS selectors for this HTML is more difficult , sometimes bit confusing too. As myself being a web developer , can understand the pain and thus came out with this plugin.
This jquery plugin helps you to generate the css selectors on a single click. Give it a try , simply paste some HTML below and click Generate.

Bookmark it


Complete collection of 642-165 dumps for guaranteed success. Pass your BH0-006 certification in first try with 646-230 online course.

Comments

Love it !!

02.18.10

Pretty neat and could be really useful – thanks a lot! Prevents spelling mistakes too.

Might be a bit overkill at the same time. Small bug: It generates CSS classes for the tags too :) .

02.18.10

Whoops – looks like my comment got edited.

“for the tags” should be “for the SCRIPT tags”

02.18.10

It was interesting to read this article and I hope to read a new article about this subject in your site in the near time.

02.18.10

Thanks, dude. It’s really helpful to choose selector.

02.18.10

very very…useful

02.18.10

Great tools! Thanks

02.18.10

= div..div :(

02.18.10

Clarifies the concept well :)

02.18.10
02.18.10

Wow that was like a special treasure trove of Oatmeal work! IMMD.

02.18.10

Kind of nice, but there are some optimizations that can be had here.
For instance, I provided some html that gave me the selector:

div#wark ul#listo li.odd dd { }

Because jQuery (and browsers) parse css selectors right-to-left, the abundance of fine detail will actually hurt performance. The fewer the items to parse, the faster the selection will be.

One obvious optimization involves ids. Since they must be unique, having the tagname is unnecessary.

Without knowing the context of the html, one can see that a more optimized selector can be:

#listo li.odd dd { }

But with deeper digging, a profiler may notice that the dd tag is used only in the context of li.odd, making that unnecessary as well.

#listo dd { }

Or that the same contained only one dd tag to begin with, making the most optimized selector just:

dd { }

Don’t get me wrong, it’s a neat plugin, definitely thanks for sharing. But getting the *exact* selector is less important imo than getting the quickest one. If it absolutely must select one element, one could give that elm an id.

02.18.10

WOW! really cool and useful tool. thanks

Yeah. these are really helpful tool.

02.18.10

Thank you for an article. Interesting material is always useful. Thanks again

02.18.10

this is great stuff

02.18.10

thanks for sharing very usefull

02.18.10

great stuff, thanks forsharing this

02.18.10

this tools very…useful

02.18.10

Nice notes to follow on writing websites, thanks for the post.

02.18.10

I found your website perfect for my needs. It contains wonderful posts.

02.18.10

Happy to see your blog as it is just what I’ve looking for and excited to read all the posts.

02.18.10

nice application, nice to share that

02.18.10

I found your website perfect for my needs. It contains wonderful and helpful posts.

wow great tools, very useful

02.18.10

want to explore more css with great design.. I love it.

It was interesting to read this article and I hope to read a new article about this subject in your site in the near time. I found your website perfect for my needs. It contains wonderful and helpful posts.

Yeah. these are really helpful tool…Thanks

great stuff, thanks forsharing this

great design.. I love it.

02.18.10

I like these CSS issues!

nice application, nice to share that

Great post, this is the quality I like to see.I’ll be sharing this with Digg, it’s something that’s gotta be Dugg for sure.I’m thinking this is the best post I’ve read on your blog yet.I’ll be back for sure, excellent stuff.

02.18.10

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post.

information space of interest. I love to read the article-article on this blog. thanks for sharing.

02.18.10

interesting, I like this post dude, thanks

02.18.10

lol That happens to me all the time.

02.18.10

If you could elaborate on how to use it that would have been far better. I really appreciate the way you presented.

02.18.10

Very nice site.

02.18.10

Nicely written. My sister carol suggested me to your blog and I have to say that it was a very good read. Danke!

great coding technique used.