About the usage of selector in jquery.dataTables.js
Hi:
I meet a problem when reading the source codes in jquery.dataTables.js.
I try to find out how this plugin add the pagination number and div to the table,
and then I see something strange which rarely to see, the code snippet is as
following:
- if ( btnDisplay !== null ) {
node = $('<a>', {
'class': classes.sPageButton+' '+btnClass,
'aria-controls': settings.sTableId,
'aria-label': aria[ button ],
'data-dt-idx': counter,
'tabindex': settings.iTabIndex,
'id': idx === 0 && typeof button === 'string' ?
settings.sTableId +'_'+ button :
null
} )
.html( btnDisplay )
.appendTo( container );
The problem is the instruction following
- $('<a>', {.....} )
the result is it set the attribute to a, but I doesn't see any explain about this usage,
is anyone know the reason. Thank a lot.