I have following working code in HTML and JS:
HTML:
<label class="slider-text" for="masterChannel">
JS:
const masterChannel = document.querySelector('#masterChannel');
//Do more stuff...
now my plan is to convert my entire html code to JavaScript and so far, I have this:
var label = document.createElement("label");
label.classList.add("slider-text");
//here I need to add the 'for' attribute to 'label' tag
I was not able to find any method in JS to add for attribute to a tag and I am not sure if I can achieve the same result with a different approach.