I have a problem with my code. I am trying to add a background color to div if data attribute is true. This is my HTML code:
<html data-highcontrast-applied="true">
<head>
</head>
<body>
<div class="row-centered">
<p>
Helllllllooooooooooo
</p>
</div>
</body>
</html>
This is jQuery code
$(document ).ready(function() {
if(typeof $("html").attr('highcontrast-applied') == 'true')
{
$(".row-centered").css({"background-color": "red"});
}
});
Can somebody help me with this? Also this is a jsfiddle link: https://jsfiddle.net/dmv9o3ep/2/