+ 16
Why error in my code 😭😭
10 ответов
+ 5
window.onload=function(){
var form=document.getElementById("form")
form.addEventListener("submit", function(event){
event.preventDefault()
var reader = new fileReader() ;
var name=document.getElementById("image").files[0].name
console.log(name);
});
}
+ 3
+ 3
Divya Mohan
But it is saying form is not defined
+ 3
Your firm is not a global variable.
It is defined in window. On load function which you have just close in line 4
+ 3
Divya Mohan
Do what can I do
+ 2
Input type file not pop up option here in solo learn to upload files due to safety reason.
I had also tried it once.
+ 1
In html close form tag <> in L ne 10 and div tag <> which is in line 9
And define fileReader() in js
- 1
hooa