Good afternoon!
I'm inserting within a TAG HTML% with% some blanks, to complete the number of characters within a certain description (120).
I need white space to be visible on the page.
TAG :
<p>
However, I'm having a problem adding white space.
I tried to use the ALT + 255 character, vulgar ' <p class="descricao">Exemplo de texto</p>
' , but the spaces are not being inserted, I also tried using ' ' but it did not work.
I did some testing, and when I replaced the white character with letters and numbers, it works normally.
Can anyone help?
Below is the Javascript code I'm using:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><pclass="descricao">Exemplo de texto</p>
<script>
var publicacoes = $( '.descricao' );
for (var i = 0; i < publicacoes.length; i++)
{
var texto = publicacoes[i].textContent;
var textoComplementar = " ";
for (var j = 0; j < (120 - texto.length); j++)
{
texto += textoComplementar;
}
publicacoes[i].textContent = texto;
}
</script>