Detect compatibility of the new HTML5 tag with jQuery.



Use the following to check the compatibility of the HTML5 tag <mark>:

var $myEL = $('<mark>');
$myEL.appendTo('body');
var bgColor = $myEL.css('backgroundColor');

if (/rgb\(255\, 255\, 0\)/.test(bgColor))
   return true;
else
   return false;

Advertisements