Simple item filter in JavaScript
- include file
filter.js
in HTML head element - call function
filterList(x)
, wherex
is array of object properties:
name
: class name of attribute to filtertype
: type of attribute (str
for string type,num
for numeric type andenum
for enumeration type)- e.g.
x = [{name:"nazov", type:"str"}, {name:"cena", type:"num"}, {name:"autor", type:"enum"}]
- optional style definition by editing and calling function
styleForm()