I'm trying to make a responsive drop down menu for my website so I decided I wanted to use javascript to make the situation easier. But for some reason I can't even get this simple js code to work, the color of my text is not changing to red. I'm not sure what I've done wrong, but any help/suggestions are very appreciated.
const mq = window.matchMedia("(max-width: 500px)");
if (mq.matches){
document.body.style.color = "red";
}