Where does “data-toggle” attribute of bootstrap framework come from?

后端 未结 4 1910
故里飘歌
故里飘歌 2021-02-01 03:15

I am trying to use some of the jQuery plugins for the Bootstrap framework and they use an attribute named \"data-toggle\". I am getting the warning \"attribute data toggle is n

4条回答
  •  独厮守ぢ
    2021-02-01 03:17

    In HTML5, any attribute that starts with data- is a valid custom attribute. Basically, it's a way to attach custom data to elements that aren't explicitly defined in the HTML specification.

    In earlier versions of HTML, this does not validate, however. Don't worry about that too much though. Browsers generally just ignore attributes they don't know about. This doesn't stop libraries like jQuery from reading them.

提交回复
热议问题