Using Javascript, How to get number of items of radio button with the same id in html;
I am aware if I can wrap a form on top of the radio button I can get the length like
document.formname.radiobtnobj.length;
Wondering if is there a way I can get the number of items if I do not have a parent form to that control.
All IDs must be unique. Duplicating IDs is BAD HTML.
That being said, one way to do what you intend is to give all of the radio buttons a class name, and get all of the items that share that class name.
In forms we usually group radio buttons by giving them the same NAME, not ID. In this case, the elements are an array.