function setExclusive() { const answers = document.querySelectorAll("input.answer"); answers[0].setAttribute("type", "radio"); answers[1].setAttribute("type", "radio"); answers[2].setAttribute("type", "radio"); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter