Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

149
Visualizações
How to make bootstrap tooltip always visible in Pure JS?

Hi I was looking for solutions about having the tooltips of my page always visible and came accross the following SO question. However all the solutions provided to this is using JQuery.

Here is the code used to always show the tooltip which I want to convert to JS but I don't know how. I haven't found much documentation about this.

$('p a').tooltip({placement: 'bottom',trigger: 'manual'}).tooltip('show');

The JQuery code above seems to be working okay. You can test it here (w3schools).

And Here is my HTML:

<span class="span-navigator-above-1" data-toggle="tooltip" data-original-title="Tooltip on top" data-placement="top" style="z-index: 3;">

    <div data-title="Event Information" id="progress-bar-indicator-button-1" class="progress-step progress-step-active"></div>
</span>

UPDATE 1:

As per my comment on coll's answer

in a loop: {
   //Indicator Progress Span (above bullet with text) 
   span = document.createElement("span");
   span.className = "indicator-tooltip-target";
   span.style.zIndex = "3";
   span.setAttribute("data-toggle","tooltip");
   span.setAttribute("data-original-title", "test");
}

later in the code in another loop: {
   let tooltips_target = document.getElementsByClassName("indicator-tooltip-target");

   for(var i=0; i<tooltips_target.length; i++){
      let tooltip = new bootstrap.Tooltip(tooltips_target[i]);
      tooltip.show();
   }
}

screenshot

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Though you've updated your tags and don't explicitly state which your asking about:

In Bootstrap 4's docs, jquery is required for tooltips to function:

Many of our components require the use of JavaScript to function. Specifically, they require jQuery, Popper.js, and our own JavaScript plugins.

In Bootstrap 5's docs, you can run the show command through vanilla JS with:

var myTooltipEl = document.getElementById('myTooltip')
var tooltip = new bootstrap.Tooltip(myTooltipEl)
tooltip.show()
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda