I have this code in template
{% block content %}
<script>
function onChange(event) {
console.log("log")
}
</script>
<h3>List</h3>
<input type="text" placeholder="Filter by..." onchange="onChange(event)" value={{ searching_value }} >
But it doesn’t seem to work..
>Solution :
As @schillingt mentioned, the argument of onChange is a Event. So you should treat it like one 🙂
{% block content %}
<script>
function onChange(event) {
console.log(event.target.value)
}
</script>
<h3>List</h3>
<input type="text" placeholder="Filter by..." onchange="onChange" value="{{ searching_value }}"/ >