Print Var in JsFiddle

后端 未结 12 1659
眼角桃花
眼角桃花 2020-11-30 16:18

How would I print something to the result screen in JsFiddle from my JavaScript. I can\'t use document.write(), it doesn\'t allow it, neither print

12条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 16:49

    With ES6 tricks could be

    function say(...args)
    { 
        document.querySelector('#out').innerHTML += args.join("
    "); } say("hi","john");

    Add only

     
    

    in HTML

提交回复
热议问题