JSFiddle - React, Tailwind, and code Playground
HTML
<ul id="results"></ul>
JavaScript
var $results = jQuery("#results"),
selectors = {
existence: "object[type]",
value: "object[id=flash]",
quoted: "object[type='application/x-shockwave-flash']",
contains: "object[type*=flash]",
"negative contains": "object:not([type*=java])",
"non-qSA": "object:not(:animated)[type]"
};
jQuery("body").prepend("<object id='flash' type='application/x-shockwave-flash' data='http://www.adobe.com/main.swf' style='width: 100%; height: 1em;'></object>");
$results.append(
"<li>flashObject.getAttribute: " +
jQuery.type( jQuery("#flash")[0].getAttribute ) +
"</li>"
);
jQuery.each( selectors, function( label, selector ) {
var description = label + " (<code>" + selector + "</code>)";
try {
$results.append( "<li>" + description + ": " +
jQuery( selector ).length + "</li>" );
} catch ( x ) {
$results.append( "<li>" + description + ": " +
x.message + "</li>" );
}
});