However document.write is a bad idea. I’d look into doing DOM manipulations instead, or using jQuery.
This seems like an unrelated question. You can generate your radio buttons using a collection list, and Webflow’s new CMS-bound ID’s and attributes feature will work great for you here.