Q:

jQuery Metadata selector

Hi I have lot of divs like this
<div class="card {toggle:'A'}">
<div class="card {toggle:'B'}">
<div class="card {toggle:'C'}">
<div class="card {toggle:'D'}">

Now I want to hide eg. B DIV. Im trying to 
$(.class [toggle:A]).hide(); 

or some other combination, but nothig was working. Could you suggest any solution. Im using "Metadata - jQuery plugin for parsing metadata from elements".
Thanks a lot

A:

EDIT
I didn't realize you were using the metadata plugin. You should be able to do something like 
$("div.card").forEach(function(element) {
    if (element.metadata().toggle === 'B') {
        element.hide();
    }
});

EDIT 2
The metadata plugin was deprecated in 2011:

"The Metadata plugin will be deprecated, in favor of similar
  functionality provided by jQuery 1.4.3 and above."

Use jQuery's own .data() instead.
ORIGINAL
This seems like you're doing something wrong upstream. Why are you storing data in the class attribute? One option to consider is to use jquery's .data() to store stuff. I strongly suggest you take a look at doing something like that.
However, if you want to blindly plunge forward, I can help. CSS supports attribute selectors. In this case, you can use the [rel$=foo] form to match against the end of the class attribute:
$('div[class$="B\'}"]')

Note the messy escape characters involved.
A better solution is probably to use the [rel*=foo] form to match anywhere in the attribute:
$('div[class*="toggle:\'B\'"]')

I've made an example here:
http://jsfiddle.net/pabo/pxg0v8uq/
You can read a nice easy guide to attribute selectors here: http://css-tricks.com/attribute-selectors/

