1
The problem I have is this. I have a code that generates several html results for me. I just need a detail I couldn’t implement. The code is as follows::
$('#avaliacoes').append('\<div class=\'estrelas\'><input type=\'radio\' id=\'cm_star-empty\' name=\'fb\' value\'\'/>
From another code, I get a variable resulting from a foreach. Its name is result[i]. Name
The only thing I need is to insert this variable and concatenate with the value of the attribute name of the input tag.
How can I do this using the append above?
All right, vlw Sergio!
– DiChrist
@Great dichrist. Now when I looked at the answer again I modified it by another way I like it even more. So it won’t call
$('#avaliacoes')
times more needlessly.– Sergio
@Sergio O
return + [...
, what it does for sure. I can’t test it now but I’m curious– Miguel
@Miguel the function
Array.reduce
needs the callback to return. On this line I am returning the string accumulated with the new one that builds it with an Aray and a.join('')
at the end to concatenate.– Sergio