A very basic question…
I have a jquery function that fires on page load:
$(document).ready(function () {
// some code
$('#filter').keyup(function() {
});
}
The code filters the first column in a HTML table. I now want to filter by the nth column but I don’t want to write two very similar functions.
I can change the function to accept a single argument like so:
$(document).ready(function (column_num) {
// some code
$('#filter').keyup(function() {
});
}
which is fine. However, how do I execute the function in my HTML file giving the function a single argument?
HTML:
JavaScript:
See demo here: http://jsfiddle.net/3cte4/2/