1
how to print the variable click inside the Html
<script type="text/javascript">
$(".j_requerimento").click(function(){
var click = 1;
$(".j_label_requerimento").append("<span>IMPRIMIR AQUI A VARIAVEL CLICK</span>");});
</script>
1
how to print the variable click inside the Html
<script type="text/javascript">
$(".j_requerimento").click(function(){
var click = 1;
$(".j_label_requerimento").append("<span>IMPRIMIR AQUI A VARIAVEL CLICK</span>");});
</script>
1
From what you wrote, just make a small change:
<script type="text/javascript">
$(".j_requerimento").click(function(){
var click = 1;
$(".j_label_requerimento").append(`<span>${click}</span>`);});
</script>
In that case, we use the Template Strings ES6. However, this is not supported in all browsers. Therefore, another option is to use:
<script type="text/javascript">
$(".j_requerimento").click(function(){
var click = 1;
$(".j_label_requerimento").append("<span>" + click + "</span>");});
</script>
Browser other questions tagged javascript html jquery
You are not signed in. Login or sign up in order to post.
thank you very much solved my problem !!
– diogo Dsa