textDecoration:none doesn't wanna work on cssText when I try to change it using js
document.querySelectorAll("nav > *").forEach(function (e) {
e.style.cssText = " textDecoration:none ;color: #000";
});
CSS properties use dashes to separate words like this: text-decoration. In JavaScript, these same properties are referenced in camelCase instead.
https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration
There are two solutions:
Either use the dashed-out property name, as is correct in CSS:
e.style.cssText = "text-decoration: none; color: #000;";
or reference the properties in JavaScript:
e.style.textDecoration = "none";
e.style.color = "#000";