Add a clear button to pad

This commit is contained in:
Robbie Antenesse 2018-02-21 10:48:10 -07:00 committed by Robbie Antenesse
parent 720e64af40
commit b9735711b3
2 changed files with 16 additions and 1 deletions

View File

@ -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">

View File

@ -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 = '';
}
}