I want to make a reset button for a jquery tokenfield, but dont know how to reset it.
HTML
<input type="text" class="input" name="testtokenfield" id="testtokenfield" placeholder="testtokenfield" value="">
<button onclick ="clear()"></button>
JS
$('#testtokenfield').tokenfield({
showAutocompleteOnFocus: true
});
function clear(){
document.getElementById('testtokenfield').value = "";
}
question from:
https://stackoverflow.com/questions/65920383/how-to-clear-tokenfield-with-js 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…