+ 1

How to make image uploader -Web

I'll narrow z question down: So there is <img src=""> </img> The img doesn't have any SRC, but the value is the src <input type ="text">will be the SRC of the image. So this put into proper code: html <Img src =""></img> <Input type="Text"> <button onclick ="check()"> </button> J.S. function check(){ Img.src = Input.value; } ^That already looks like It works, --I don' think it does. Can someone put those words | codes | things above Into a proper code to make an Image uploader? --

29th Jun 2019, 6:23 AM
Ginfio
Ginfio - avatar
13 ответов
+ 4
Jason Kennedy Thank you very much. I really appriciate your help! •
30th Jun 2019, 12:58 AM
Ginfio
Ginfio - avatar
29th Jun 2019, 5:19 PM
Ginfio
Ginfio - avatar
29th Jun 2019, 5:48 PM
Ginfio
Ginfio - avatar
29th Jun 2019, 7:52 PM
Ginfio
Ginfio - avatar
+ 3
https://code.sololearn.com/W77yvv2R8mso/?ref=app i fixed it as promised. i even kept your original way just be aware..the image cannot technically be uploaded..so it has to be an image url in the text box. in order to truly allow image uploads..you need a database to store the pics
30th Jun 2019, 12:54 AM
Jason Kennedy
+ 2
did you try it
29th Jun 2019, 7:33 AM
Jason Kennedy
29th Jun 2019, 5:08 PM
Ginfio
Ginfio - avatar
+ 2
you still need js to get the id of the img tag with document.getElementById...your JS does not know what img.src is it also needs to je connected to the input
29th Jun 2019, 5:11 PM
Jason Kennedy
+ 2
Jason Kennedy will the JS know what src is?
29th Jun 2019, 5:12 PM
Ginfio
Ginfio - avatar
+ 2
no..its best to create an empty div in js get the id of the text input get divs id and put div id.innerHTML = <img src=TEXT INPUT VALUE VArIABLE> id do more for you but no time hope this bit helps
29th Jun 2019, 5:22 PM
Jason Kennedy
+ 2
put the img element in single quotes
29th Jun 2019, 6:10 PM
Jason Kennedy
+ 2
Jason Kennedy could please add to my code or give me a little code to what what u think works? cuz i don't really understand.
29th Jun 2019, 7:17 PM
Ginfio
Ginfio - avatar
+ 2
i apologize im preoccupied..when i have more time ill fix it
29th Jun 2019, 7:51 PM
Jason Kennedy