Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="jquery.qrcode.js"></script>
<script src="qrcode.js"></script>
<link href="css/style.css" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
$(function() {
var url;
$('#send').click(function () {
url = $('#text').val();
console.log(url);
if(url != '') {
$("canvas").remove();
$("#qrcode").html();
$("#qrcode").qrcode({text: url});
}
});
});
</script>
<title>QR code generator</title>
</head>
<body>
<header>
<h1 id="title">QR code generator</h1>
</header>
<div id="wrap">
<h3>generating QR codes</h3>
<form>
<input type="text" id="text">
<input type="button" value="send" id="send">
</form>
<div id="qrcode"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment