Created
November 4, 2018 07:14
-
-
Save cftang0827/02713cefd94ef14bbdcc162ef6cfa974 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
function show_image() { | |
document.getElementById("show").setAttribute("src", "data:image/jpeg;base64," + document.getElementById('base64_img').value); | |
} | |
</script> | |
</head> | |
<h1> Base64 encoding</h1> | |
<p> input base 64 encode below: </p> | |
<input style="height:200px; width:400px" id="base64_img"> <br> | |
<button type="button" onclick="show_image()"> Submit</button> | |
<br><br> | |
<img id="show" alt="Base64 image" width="200" src=""> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment