js & input event & input change event
vue & search & input change
<input
@click="onInputClick"
@change="onInputChange"
@input="onInputChange"
v-model="input"
class="chatroom-footer-input"
/>
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
const nameInput = document.querySelector('input');
const form = document.querySelector('form');
nameInput.addEventListener('input', () => {
nameInput.setCustomValidity('');
nameInput.checkValidity();
});
input & input event
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event
<input placeholder="Enter some text" name="name"/>
<p id="values"></p>
const input = document.querySelector('input');
const log = document.getElementById('values');
input.addEventListener('input', updateValue);
function updateValue(e) {
log.textContent = e.srcElement.value;
}
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event
refs
©xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!