skip to Main Content

Html – How to obtain the *actual* URL of an image?

Consider the following html page: function correctTitle() { const imageElement = document.getElementById('image'); const titleElement = document.getElementById('image-title'); titleElement.textContent = 'Image URL: '+imageElement.getAttribute("src"); } <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <body> <h1 id="image-title">Loading...</h1> <a href="https://loremflickr.com/g/320/240/paris"> <img…

VIEW QUESTION
Back To Top
Search