0
Form value not showing
Am trying to get the value of the form Input using a function but it's not working https://code.sololearn.com/W9GQGRanmesm/?ref=app
4 Réponses
+ 2
You are using wrong ID name in your JavaScript function.
ID of the textbox is email.
So you have to use that ID in your function.
function checkInp(fieldId){
var val=document.getElementById('email').value;
console.log(val);
}
+ 1
idris
Since you passed the input element via the function you don't need to try and get it again by getElementById()
https://code.sololearn.com/WY9uZdlA5H3C/#html
0
Why can't I pass fieldId in the get element because in the html I already passed email in there?
0
Thank you so much it makes so much sense to me now