window.onload=function(){ var arrInput=document.querySelectorAll("input"); alert(arrInput[0].dataset.name); alert(arrInput[1].dataset.nameFirst); }