Reputation:
For example, if I type bs-
I want to highlight all the result containing bs-
How do I do that in CSS ?
I am using a DataTable.
Upvotes: 0
Views: 96
Reputation:
Thanks to @sdcr for pointing me to the right direction.
I accomplish that by doing the following :
1- Include JS CDN
<script src="//bartaz.github.io/sandbox.js/jquery.highlight.js" type="text/javascript"></script>
<script src="//cdn.datatables.net/plug-ins/f2c75b7247b/features/searchHighlight/dataTables.searchHighlight.min.js" type="text/javascript"></script>
2- Include CSS CDN
3- Add "searchHighlight": true
as part of your setting.
My whole setting look like this :
// Setting to Inventory Table
$('#inventory').dataTable({
"lengthMenu": [ 10 ] ,
"bLengthChange": false,
"searchHighlight": true
});
My final result :
Upvotes: 1