1
I have a small string to display in Javascript, but after much trying, I learned that if there is enter in the middle of the string snippet it will not be displayed. Can someone explain to me if there is a way to organize the code without disabling the display.
Follow the code:
function outros(){
var exibir;
exibir = '<input type= "checkbox" name="st[]" value="Penicilina">Penicilina <br> <input name="st[]" value="Contraste" type="checkbox">Contraste <br>';
elexibir= document.getElementById('teste1');
elexibir.innerHTML= exibir;
}
Possible duplicate of Multiple lines of text or code using the ". html method()"
– Guilherme Nascimento
@Guilhermenascimento gave a quick search and tmb had not found =]
– Brunno
@Brunno doesn’t need to delete her answer, in fact she has something else, about ES6 (which could be asked in the oldest question), but the tip I gave her is for future questions, I even doubled unintentionally, this is normal, the instruction there is even for the next times, now it’s up to you to restore or reply again :D, after all it’s quite interesting for the community.
– Guilherme Nascimento