var inputList = document.getElementsByTagName("input"); for ( var i = 0, input, checkboxName; ( input = inputList[i++] ) ; ) { if ( input.type == 'checkbox' ) { checkboxName = input.name; } }