Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Untitled
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
<form action="/abc" method="post">
<input type="hidden" id="imgData">
<div>
<img id="img1" src="" alt="">
</div>
<button type="submit">submit</button>
</form>
document.onpaste = function(event){
var items = (event.clipboardData || event.originalEvent.clipboardData).items;
var blob = items[0].getAsFile();
var reader = new FileReader();
reader.onload = function(event){
document.getElementById("img1").src = event.target.result;
document.getElementById("imgData").value = event.target.result;
};
reader.readAsDataURL(blob);
}
{"view":"split","fontsize":"100","seethrough":"","prefixfree":"1","page":"result"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.