use label.htmlFor=... instead of label.setAttribute('for', ...): the former works...