Add a clear button to pad
This commit is contained in:
parent
720e64af40
commit
b9735711b3
12
index.html
12
index.html
|
@ -52,10 +52,20 @@
|
|||
</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="control">
|
||||
<a class="button is-small is-danger" id="clearPad">
|
||||
<span>
|
||||
Clear Pad
|
||||
</span>
|
||||
<span class="icon is-small">
|
||||
<i class="fa fa-asterisk"></i>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control">
|
||||
<textarea id="inputPad" class="textarea"></textarea>
|
||||
<div class="help is-error" id="inputError"></div>
|
||||
<div class="help is-danger" id="inputError"></div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
|
|
5
index.js
5
index.js
|
@ -81,4 +81,9 @@ window.onload = () => {
|
|||
const output = generatePad(length);
|
||||
document.getElementById('inputPad').value = output.join('');
|
||||
}
|
||||
|
||||
document.getElementById('clearPad').onclick = () => {
|
||||
document.getElementById('padLength').value = '';
|
||||
document.getElementById('inputPad').value = '';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue