Skip to content

Commit b91a2f8

Browse files
authored
Merge 9640857 into e5c42fd
2 parents e5c42fd + 9640857 commit b91a2f8

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ <h1>Badge Generator</h1>
5959
<div id="badgePreview"></div>
6060
<button id="downloadSVGButton" style="display:none;">Download SVG</button>
6161
<button id="downloadPNGButton" style="display:none;">Download PNG</button>
62-
<script src="badgeGenerator.js"></script>
62+
<script src="script.js"></script>
6363
</body>
6464
</html>

src/script.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ document.getElementById('badgeForm').addEventListener('submit', function(event)
44
});
55

66
document.getElementById('clearButton').addEventListener('click', function() {
7-
// Clear number and text input fields
8-
const inputs = document.querySelectorAll('#badgeForm input[type="number"], #badgeForm input[type="text"]');
9-
inputs.forEach(input => {
10-
input.value = '';
11-
});
12-
7+
// Clear the form and result display
8+
document.getElementById('badgeForm').reset();
139
document.getElementById('badgePreview').innerHTML = '';
1410
document.getElementById('regenerateMessage').style.display = 'none'; // Hide the message when form is cleared
1511
document.getElementById('downloadSVGButton').style.display = 'none'; // Hide the download button when form is cleared

0 commit comments

Comments
 (0)