I have an input control which is a required field. However, I want to use javascript to dynamically change the required attribute so it can become NOT required. However, it doesn't work. Any idea how to make it work?
function prodType(value) {
document
.querySelectorAll(".fieldbox")
.forEach((node) => (node.style.display = "none"));
document.getElementById(map[value]).removeAttribute=("required");
document.getElementById(map[value]).style.display = "block";
}