I want to search through this table according to the first row, serial number. But i cant figure out where is the problem in my Javascript code. Here is the link. https://jsfiddle.net/naeemrind/peqv5g7f/
Thanks in Advance
I want to search through this table according to the first row, serial number. But i cant figure out where is the problem in my Javascript code. Here is the link. https://jsfiddle.net/naeemrind/peqv5g7f/
Thanks in Advance
I forked your fiddle to make some changes. Turns out you’re programmatically doing everything right (apart from one small thing) but you didn’t get the configuration right.
https://jsfiddle.net/AdityaParab/truhcpcn/1/
First, Click on javascript settings and change Load Type
from onload
to No wrap - in <head>
This will make sure your function is defined BEFORE onload event is fired. You can see this setting in the fiddle above.
Secondly, what input.value.enumerable();
? Specifically this .enumerable()
part? You don’t need that.
Change
filter = input.value.enumerable();
to
filter = input.value;
AND change
if (td.innerHTML.enumerable().indexOf(filter) > -1) {
to
if (td.innerText.indexOf(filter) > -1) {
You don’t need innerHTML here for
td:first
elementsDoing these changes, I can see rest of your code working correctly.
Thank you so much.
Actually I am new in Javascript.