So I have some really simple code but it's not working.
$(function() {
$("#tren").click(function() {
$("#trens").toggleClass("show");
});
});
.show {
color: "red";
}
<ul>
<li id="tren">Some text</li>
</ul>
<div id="trens">
<p>Other text</p>
</div>
'Other text' is supposed to get red, but it doesn't . What am I doing wrong?
Just remove the quotes in your CSS. Run the snippet below to see it work.