This site uses cookies to deliver our services and to show you relevant ads and job listings.
By using our site, you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service.
Your use of Stack Overflow’s Products and Services, including the Stack Overflow Network, is subject to these policies and terms.

Join us in building a kind, collaborative learning community via our updated
Code of Conduct.

Hello, Your option is better. But there isn't any other way to do that? Cause in the option could be "div[href=somehref" instead of "div.someelement".
– MattAug 27 '12 at 13:52

@Matt: If you want any valid CSS syntax, then you'll need a CSS string parser. The SizzleJS project has one built in that you could borrow. You'll need to modify code to your needs.
– gray state is comingAug 27 '12 at 13:53

@Matt: I added another answer that makes an element from a more complex string like you showed. Please see that answer.
– gray state is comingAug 27 '12 at 15:41

Thanks for answer but it isn't what I need. I know that there is that possibility, but it doesn't satisfied me. I have option in Jquery Plugin like someContainer: "div.someelement", and I have to create this element by someContainer Option
– MattAug 27 '12 at 13:44

I would use zen coding for textarea as a starting point. Its syntax is close enough for what you are trying to do, its a well understood implementation. You should be able to invoke the transformation from a raw string rather than from a textarea with a little tweaking.