Difference between button.dt-button and a.dt-button

Difference between button.dt-button and a.dt-button

carlopcarlop Posts: 37Questions: 9Answers: 1

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

Answers

  • allanallan Posts: 63,573Questions: 1Answers: 10,483 Site admin
    Answer ✓

    You are using different versions of Buttons. v1.5 changed from using a tags by default to using button 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

This discussion has been closed.