Difference between button.dt-button and a.dt-button
Difference between button.dt-button and a.dt-button
Hi, I am usig Editor in two different applications. In both cases the used code is of the type
buttons: [
{ extend: 'create', editor: editor },
{ extend: 'edit', editor: editor },
{ extend: 'remove', editor: editor },
{ extend: 'excel', exportOptions: {columns: [1, 2, 3, 4]}, className: 'visible-lg-inline-block' }
]
but the generated markup is different
In case 1. I get
<a class="dt-button buttons-create" tabindex="0" aria-controls="iWarranty" href="#"><span>New</span></a>
In case 2. I get
<button class="dt-button buttons-create" tabindex="0" aria-controls="iSalesTable"><span>New</span></button>
I cannot understand why in case 1. the <a>
tag is generated and in case 2. the <button>
tag is generated and I don't know how to control the choice.
I was not able to find any explanation. Can someone help me? Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You are using different versions of Buttons. v1.5 changed from using
a
tags by default to usingbutton
tags for improved accessibility.Full release notes for 1.5.0 are here. 1.5.1 is the current release at the time of writing.
Allan