我想按开头字母对包含一列的表格进行排序。所以如果我点击例如 按钮“e”页面应仅显示以“e”开头的条目。
最佳答案
假设您有一个包含数据的数组,您可以使用 javascript filter function 。像这样的东西:
var words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present'];
const result = words.filter(word => word.charAt(0) == 'e');
关于javascript - 按字母过滤表格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52206217/