What are alternatives to [removed]?

后端 未结 10 2011
北荒
北荒 2020-11-22 05:11

In tutorials I\'ve learnt to use document.write. Now I understand that by many this is frowned upon. I\'ve tried print(), but then it literally sen

10条回答
  •  抹茶落季
    2020-11-22 05:29

    The question depends on what you are actually trying to do.

    Usually, instead of doing document.write you can use someElement.innerHTML or better, document.createElement with an someElement.appendChild.

    You can also consider using a library like jQuery and using the modification functions in there: http://api.jquery.com/category/manipulation/

提交回复
热议问题