Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #15359
Closed
Open
Issue created Dec 14, 2014 by Administrator@rootContributor

How to avoid tooltips adding `title` & `data-original-title` attributes to DOM?

Created by: ricardopolo

In Bootstrap Tooltip.js you can use HTML data attributes to define title of the tooltip

<button data-toggle="tooltip" data-placement="left" title="Tooltip on left">Button</button>

And then using Javascript intialize it

  $('[data-toggle="tooltip"]').tooltip()

We have a requirement where we need tooltips without modifiying the HTML (using data attributes). The tooltips are shown in the WYSIWYG Summernote editor and we don't want the user change them using the HTML editor.

So we initialize the tooltips using only Javascript. The title and the placement are specified using JS and not HTML.

  $('[data-toggle="tooltip"]').tooltip({ 'placement': 'left' , 'title' : 'Toolt on left'})

It works. Shows the tooltip as expected but it changes the HTML adding this attributes to the element

data-original-title="" title=""

Do you know why this happen? Do you know if we can avoid this feature and not modifiy the HTML after the tooltip is shown? If not, can we work in a PR to avoid this feature?

Thanks

Assignee
Assign to
Time tracking