How to clear input


#1

how to clear input and hide input-clear-button.
im using $$(input).val(’’); but how to hide the x clear button?


#2

$$('.input-clear-button').hide();

But I do suggest try

$$(input).on('change', function(data) {
    if (data.length == 0) {
        $$('.input-clear-button').hide();
    } else {
        $$('.input-clear-button').show();
    }
});