Need help to modify my jQuery result properly into table
Hi,
I'm jQuery Newbies. Can someone help me - Modify my jQuery result properly into table? It should be particular order as following,
- QR Code
- Name
- Age
My html Code so far
- <!DOCTYPE html>
<html>
<head>
<title>Call QR Code Web API using jQuery</title>
<meta charset="utf-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body>
<table>
<tr><td></td><td> <label id="qrcode"></label></td></tr>
<tr><td>Name:</td><td> Jerry Titan</td></tr>
<tr><td>Age:</td><td> 32</td></tr>
</table>
<script type="text/javascript">
$(function () {
$("qrcode").append(qr(250, 250, "I made a qr code on " + new Date()))
})
function qr(width, height, data) {
var res = encodeURIComponent(data);
return $('<img>').attr({
width,
height,
src: 'https://api.qrserver.com/v1/create-qr-code/?size=' + width + 'x' + height + '&data=' + res
})
}
</script>
</body>
</html>
Please help