javascript - Adding but not Overwriting Text -


i have function called "startmsg" want add text div element id "screen". sadly known basic js, here have far;

function startmsg() {    document.getelementbyid('screen').innerhtml = "the            game created."; }     

but overwrites of previous text (yes know it's supposed that, i'm trying find way not overwrite add!).

use textcontent , con-cat new string

document.getelementbyid('screen').textcontent += " game created.";  

jsfiddle


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -