user3079341 user3079341 - 6 months ago 12
jQuery Question

how do i put br in javascript .text

How do i put br inside text i tried putting 'br' but it doesnt work it just display the br literally on screen

Answer

I agree with @user3284463 , You try add tag in text , and you want see rendered result! replace $('#win').text() with $('#win').html() eg :

 $('#win').html(winner+' <br /> '+'stars'+'  <br />  '+'earned'+' Completion time'+' '+ counter +' seconds');

see jQuery text
see jQuery html