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.";
Comments
Post a Comment