+ 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? --
13 ответов
+ 4
Jason Kennedy Thank you very much.
I really appriciate your help!
•
+ 3
Jason Kennedy This is my attempt:
https://code.sololearn.com/WYKN7LE9g3R3/?ref=app
--
+ 3
Jason Kennedy like this?:
Syntax Error
https://code.sololearn.com/WYKN7LE9g3R3/?ref=app
+ 3
Jason Kennedy Ok.
+ 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
+ 2
did you try it
+ 2
+ 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
+ 2
Jason Kennedy will the JS know what src is?
+ 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
+ 2
put the img element in single quotes
+ 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.
+ 2
i apologize im preoccupied..when i have more time ill fix it