One approach, which should cover most use-cases, is the following:
var Gid = "container";
// here we look inside the '#container' element to find all
// elements matching the jQuery ':input' selector expression,
// which includes <select>, <input>, <textarea>,
// and then we iterate over each of the found elements (if
// any):
$('#' + Gid).find(':input').each(function(){
// caching the current element for repeated use:
var el = this,
// localName is the same as tagName, but in lowerCase,
// for example 'INPUT' is 'input':
tag = el.localName,
// here we see if the current element has a 'type' property,
// which it does if the tag is equal to 'input'; if it does
// have a 'type' property we assign a string to tell the
// user what that 'type' is; otherwise we return an empty
// string instead (so that the later concatenation will
// still work):
hasType = tag === 'input' ? ', of type="' + el.type + '"' : '',
// a naive check to see if we should say 'an input...' or
// 'a select...':
determiner = ['a','e','i','o','u'].indexOf(tag.charAt(0)) > -1 ? 'an' : 'a';
console.log('This is ' + determiner + ': ' + tag + ' element' + hasType);
});
var Gid = "container";
$('#' + Gid).find(':input').each(function() {
var el = this,
tag = el.localName,
hasType = tag === 'input' ? ', of type="' + el.type + '"' : '',
determiner = ['a', 'e', 'i', 'o', 'u'].indexOf(tag.charAt(0)) > -1 ? 'an' : 'a';
console.log('This is ' + determiner + ': ' + tag + ' element' + hasType);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="container">
<input type="radio" />
<input type="checkbox" />
<select></select>
</div>
JS Fiddle demo.
References: