Image input. | SoloLearn: Learn to code for FREE!

+7

Image input.

How can I input an image from gallery to my code.

10/25/2020 8:05:09 PM

Jude Okeleke

29 Answers

New Answer

+7

You can copy it to the folder of your code and link it with: <img src="image_name.png"> or link the folder where it is in src Edit: This only works in a Text Editor like VS Code, not in SoloLearn

+6

HYY👋 bro use this method upload ur images to dropbox then it will give you the url of your img then copy paste it then put your url <img src="the url" /> like this hope its useful

+4

https://code.sololearn.com/WT3661NHpV3B/?ref=app

+4

<img src ="image.png">

+3

It is possible, but not for playground here. The solution for all is i.e.: https://code.sololearn.com/WSLZPpBIFgr7/?ref=app

+3

JaScript even here also

+3

Jascript what is the aim of ur code

+3

1. Sololearn is server style based app which mean can't access device file manager with this app.. So if you want to import something try to use linked file source, example: you put it in your drive and take the file in the drive link then put it into your source 2. If you want to make it such choose file from your device.. you can't make it in sololearn code tools.. because i already explain it at the first reason.. 3. Use another tools that can access device file manager.. don't use sololearn.. Don't worry, code is code.. never saw where you make it, the code is still have the same function that executable.. What make it don't work if the tools didn't support much or less of your code, if the code have invalid syntax, if you didn't put anything.. That's from me.. Always confident and keep typing! :>

+3

Dropbox is the app to do it all install it on your phone and you are good to go. It helps you get files from your phone and insert them in your code on sololearn. So after installing it click on the plus sign and then click on upload files. Navigate through your phone and get that file. Choose the file you want to insert in your code it can be an img, audio, vodeo . After that wait untill upload and click on that img or what ever file . Click copy link and paste it into sololearn Eg: https://www.dropbox.com/s/4zsk9vjprvzivl4/Alan-Walker-Alone.mp3?dl=0 That is the copied link for an audio from my phone so to make it work in sololearn.Change the "www" to "dl" and delete the "?dl=0" and you are done. In sololearn the above link looks lile this; <audio controls> <source src="https://dl.dropbox.com/s/4zsk9vjprvzivl4/Alan-Walker-Alone.mp3" > </audio>

+2

It says TypeError: Can not read property "style" of null in line 11 of js code does it work if you run it?

+2

Eacy in pc web browser (which?), android app or apple app?

+2

JaScript Android App But it shouldn't matter

+2

Yes, of course otherwise I would not show it anymore.

+2

Thank you, for your exact reference. I changed it. Now the error should not occur by you anymore.

+2

JaScript sry i have to say it, but now there is a TypeError in line 41 says: Can not read property "addEventListener"of none But i don't understand why its an error, bc the button with id up is there so it shouldn't be null. 🤔

+2

Jude Okeleke the code shows how to insert / show an image in sololearn code playground in html.

+2

JaScript your problem has been solved

+2

https://code.sololearn.com/Wt1M302AIsVY/?ref=app

+2

Frist upload your image on online image hosting website Sacond copy image url form hosting website Thrid <img src="paste url"> copy this 👆 code and paste your project Forth paste image url on under tha img tag src attribute Five practice now

+2

You move it to the folder where your code is then you use the <img src="name.jpg">