I am fetching list from database and displaying them dynamically as radio buttons.
I am using html:radio tags. Now I want to validate these radio buttons and
alert that atleast one radio button is mandatory.
First, ditch any illusion that the fact that the elements are generated by Struts tags has anything at all to do with it. Those tags execute on the server and end up sending plain old HTML to the browser. It's that HTML that matters. A View Source, or opening the JavaScript debugger, will reveal the HTML sent to the browser. That's what your JavaScript code will be working with.