/    Sign up×
Community /Pin to ProfileBookmark

Searching an html table after filtering rows

I have a table which i have filtered rows based on the criteria i have specified in a dropdownlist.
After I have applied the filter i would like to do a text based search. I found some javascript code that does a search but it also searches the rows that i have filtered or hid. I just want to search the rows that were not filtered. I greatly appreciate any help with this. See the below code that i am using for the search.

<script>
$(document).ready(function(){
$(“#myInput”).on(“keyup”, function() {
var value = $(this).val().toLowerCase();
$(“#myTable tr”).filter(function() {
$(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
});
});
});
</script>

to post a comment

2 Comments(s)

Copy linkTweet thisAlerts:
@rootOct 10.2018 — Thats not JavaScript.

*moved*
Copy linkTweet thisAlerts:
@rootOct 10.2018 — [[2,3,4],[2,52]]
×

Success!

Help @RonR spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...