Customizing form types with JavaScript

How can I call, for instance, a radio button field built in the form.md from a JavaScript file in order to customize it? Can I use document.getElementsByName() javascript function?