[Javascript] Get Elements by type

Table of Contents

var frm=document.getElementsByTagName("FORM")[0]; frm.setAttribute("id", "test"); var inputs = document.getElementsByTagName('input'); for(var i = 0; i < inputs.length; i++) { if(inputs[i].type.toLowerCase() == 'file') { alert(inputs[i].value); alert(inputs[i].id); } } -soiqualang_chentreu-  ]]>

Leave a Reply

Your email address will not be published. Required fields are marked *