I use the input type to make a live search.
But I need to have a function that auto input the value into the live search input element.
I try to write the code in console: $("#querySearch").val("test");
it didnt cahnge the value on the input element, but check by $("#querySearch").val(), it return "test"
I also set the code, $("#querySearch").val("test")on document reday and onload function, it output same result.
But I set this code inside an onclick function, the input element can display "test" immediately.
I use the input type to make a live search. But I need to have a function that auto input the value into the live search input element. I try to write the code in console:
$("#querySearch").val("test")
; it didnt cahnge the value on the input element, but check by$("#querySearch").val()
, it return"test"
I also set the code,
$("#querySearch").val("test")
on document reday and onload function, it output same result.But I set this code inside an onclick function, the input element can display "test" immediately.