Getting src image

I’m trying to add a image to my page, but I can’t figure out how to get the src for it (it’s in my PC)

<h1 id="MainText"></h1>
<h2 id="MainText2" ></h2>
    <img src="got em3.png" width="400" height="200"> <br>  
<p id ="ColouredText" style="color:red; font-family: sans-serif;"> 

const theHeader = document.getElementById("MainText")
const ColouredText = document.getElementById("ColouredText")
const RandomNum = Math.random()
theHeader.textContent = "Random number of the day: " + RandomNum
ColouredText.textContent = "wow"

Path (if you need it)

C:\Users\capta\Downloads\The_Rake_Files\New folder\got em3.png

give the src the full path

1 Like

(post deleted by author)

actually local files are not allowed access if the html file is not also local to that computer. you can upload the image somewhere like google drive

How could I get it from google drive?

file://c|/localfile.jpg I found from stackoverflow, try it replace localfile with your actual adress

Same result

if you are using linux than file:///localfile.jpg

I’m not using linux.

  <img src="file://c|/C:\Users\capta\Downloads\The_Rake_Files\New folder\got em3.png" width="400" height="200"> <br>  

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.