I'm trying to allow users to capture screenshots of targetted elements (paragraphs) of my webpage and then displaying the captured screenshot on a div (not canvas) where they can download the screenshot.
Here is a visual of what I'm trying to accomplish: https://i.stack.imgur.com/Vuar6.png
This is what I've tried so far:
HTML
<p id="content">lorem ipsum bla blah, screenshot me like one of your French girls</p>
<h1>Right click image in div below and download:</h1>
<div id="display" width="500" height="200"></div>
<button>capture</button>
JS
document.querySelector("button").addEventListener("click", function() {
(document.querySelector("#content")
});
};
CSS
#display {
border: 1px solid black;
}
button {
clear: both;
display: block;
}
#content {
background: rgba(100, 255, 255, 0.5);
padding: 50px 10px;
}
Any suggestions?