刚开始使用DataTables.js前几天,我想知道您是否可以为表中的特定元素提供自定义 id
/class
/name
值。例如,我已经更改了表格顶部“搜索”功能的文本,但现在我想为输入框指定一个特定的 id
。
这是我目前的尝试。
jQuery
$("#thetable").dataTable({
"sPaginationType": "full_numbers",
"iDisplayLength": 100,
"oLanguage": {
"sSearch": "Filter results:"
}
});
$.fn.dataTableExt.oJUIClasses["sFilter"] = "my-style-class";
呈现的 HTML
最佳答案
$('#thetable_filter input').attr('id', 'myId');
关于javascript - 为 DataTables.js 元素提供特定的 id/class/names,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20551112/