It seems addClass
is not working with IE8 for some reaosn. I made a <div>
and a <p>
, and I want to assign a class to <p>
when the <div>
is clicked but it is not working in IE8.
.test {
width: 100px;
height: 100px;
background: red;
}
<div class="test"></div>
<p>deeded</p>
$('.test').click(function() {
$('p').addClass('code');
});
The class does not get added in IE8. Why?