Tony Tony - 1 year ago 43
jQuery Question

What's the meaning of "data-api" in Twitter Bootstrap's Tab plugin

There is a piece of code as

* ============ */

$(function () {
$('body').on('', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {

in the file Bootstrap--tab
I don't understand the
'[data-toggle="tab"], [data-toggle="pill"]'

Who could explain it for me? THANKS~~

Answer Source

the is a click event with Namespace ''. you can look at the document here (event and namespace section).

If I remember correctly, the data-* is a new custom data attribute in Html5 standard, it comes handy when you want to define you own attributes or data. check out John's post explaining data attribute.