This is a line inside a for in with jQuery append:
<span id="TITLE'+i+'"
class="card-title activator grey-text text-darken-4">'
+$(".card-title").attr("id")
+'<i class="material-icons right">more_vert</i></span>'+
When i=1
, I want the part of
TITLE'+i+'
with the value of that variable (for example, to evaluate the value of TITLE1
, TITLE2
, etc.). And the same in the part where the text of the span is, that is to say in:
$(".card-title").attr("id")
to be taken as a variable and take the value that corresponds to the variable TITLE1
in JavaScript.
I saw that in PHP you can do something similar to
$$Nombre_de_Variable
, but I do not know how to do it here.
If someone can help me or know of an alternative, I would appreciate it.