Here is my HTML and I want to show source code of url with (view-source+url) inside class .source-html from input when I click on button?
const input = document.querySelector("#input");
const button = document.querySelector(".view");
button.addEventListener("click", (x) => {
const url = input.value;
const sourceUrl = "view-source:" + url;
//Some code that show source of url inside div
});
<input id="input" type="text" />
<button type="button" class="view">View Source</button>
<div class="source-html"></div>
If possible, help me.