Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Detect compatibility of the new HTML5 tag <mark> with jQuery.

How can I detect compatibility of the new HTML5 tag <mark> with jQuery? I want to check the compatibility of <mark> tag.


1 Answer
Daniol Thomas

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

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.