How to make the search value change via javascript?
- Dominant language
- HTML
- Stars
- 435
- Forks
- 168
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Look at the jplist source code for the search input handling, likely in a file like jplist.js or a module for live search. Check how the input event is triggered and why setting .val() programmatically doesn't update the UI. Test by triggering a change or input event after setting the value, and verify the search results update.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, jquery
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100