1<input type="text" class="form-control" placeholder="Search" id="search_id"/>
2<script type="text/javascript">
3const log = document.getElementById('search_id');
4document.addEventListener('keyup', logKey);
5function logKey(e) {
6 const value=log.value;
7 if (e.key === 'Enter' || e.keyCode === 13) {
8 transmit({search: value});
9 }
10};
11</script>
1A function is triggered when the user releases a key in an input field ( such as textarea, <input>, etc.)