everyone,i am a beginner about js,so i have a Question,code:
var formDate=$("#formStudentInfo").serializeArray();
var inputArray=[];
for (var i=0;i<formDate.length;i++) {
var element=$('#form_'+formDate[i]['name']);
inputArray.push(element);
console.log(inputArray)
inputArray[i].on('click',function(){
console.log(inputArray[0]['name']);
})
}
i have a form name is #formStudentInfo,there are two input in this form,input name is "form_name"and"form_userName",How do I get the input name,when i click input? thanks everyone
<element onclick="myScript">