function checkForm(){ var form = document.forms[0]; var selectElement = form.querySelector('input[name="pwd"]'); var selectedValue = selectElement.value; }