i have been having a hard time trying to get pictures into my script i have been using JSFiddle and i need help
For further actions, you may consider blocking this person and/or reporting abuse
i have been having a hard time trying to get pictures into my script i have been using JSFiddle and i need help
For further actions, you may consider blocking this person and/or reporting abuse
Purnima Shrestha -
Ankita -
Andrey Polischuk -
Mangai Ram -
Top comments (6)
You can use
document.createElement()
method to create an an empty img element, then add the source.I think that's what you were looking for, right?
yes thank you
If you want to load an image into the page, this looks fine. If you do not want to load it into the DOM, then you should be able to do a simple HTTP request to get the image.
Can you please describe the issue more, @looph8le ?
i dont know how to add pictures to javascript
Get pictures from where? If it's from an API then fetch is your friend. If it's from your computer you can use an
<input type="file" />
+ an eventlistener; onChange should work.BTW I would suggest to change the #tutorial tag for #help
don't know but use #help as a tag in the future