document.getElementById(\'frmMain\').elements
can i use like this
document.getElementByName(\'frmMain\').elements
getElementById returns either a reference to an element with an id matching the argument, or null if no such element exists in the document.
getElementsByName() (note the plural Elements) returns a (possibly empty) HTMLCollection of the elements with a name matching the argument. Note that IE treats the name and id attributes and properties as the same thing, so getElementsByName will return elements with matching id also.
getElementsByTagName is similar but returns a NodeList. It's all there in the relevant specifications.