jQuery equivalent for window.[removed]

前端 未结 3 611
南笙
南笙 2021-01-04 08:37

Does anyone know the jQuery equivalent for window.document.write(\'\') in javascript? Thanks

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-04 09:01

    First, jQuery is JavaScript, it is just a library of functions to make coding easier.

    Second, you should avoid the use of document.write. You should use jQuery to append the text to the DOM element you want.

    Example:

    $('#myDiv').append('some new text')
    

提交回复
热议问题