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;

Updated on: 29-Jan-2020

92 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements