0
I am trying to change a certain value within my html code, through JS-JEQUERY, but this not changing, my logic is wrong ?
Follows the code:
var valor = "texto";
$('.botao botao-comprar principal grande desativo with-popover').on('click', function () {
$(this).data('data-content', valor);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<a href="javascript:;" class="botao botao-comprar principal grande desativo with-popover" rel="popover" data-placement="left" data-trigger="hover" data-content="Selecione uma opção de atributo disponível." data-original-title="IMPORTANTE">
<i class="icon-shopping-cart"></i> Comprar
</a>
Cara, what is the value of your variable
texto
(var valor = texto;
)? Because if it is a text, as the name suggests, it makes no sense to use incrementvalor++;
– Gabriel Queiroz Schicora
corrected, I was doing some tests
– Vitor Giovanny
Failed to add the points in the classes, you just put in the first:
$('.botao .botao-comprar .principal .grande .desativo .with-popover')
– Sam