Hello my english is not really good. i build a little qr code generator but i have some problems with it. when i press two times on my "click me" button it dosent replace the old qr code with the new one it makes a new one and place it under the old one but i want replace the old one
here is my html and javascript
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<select name= "Bauart" id= "qr-data">
<option value="1">test</option>
<option value="ad">test 2</option>
</select>
<button onclick="myFunction()">Click me</button>
<div id="qrcode"></div>
<br>
</body>
<script src="qrcode.min.js"></script>
<script src="javascript.js"></script>
</html>
and here is the javascript
function myFunction() {
var qrdata = document.getElementById('qr-data').value;
var qrcode = new QRCode(document.getElementById('qrcode'));
qrcode.makeCode(qrdata);
}