+ 1
how do I get img src
2 Answers
+ 1
Its not clear what you want exactly !
You want to know the src of an img using JS or you want to display an img ?
If you're asking The JS way :
//target the img element first
const img = document.querySelector("#myImg")
//then simply get the src attr
img.src
0
Yes please describe your question in more detail.