What is the difference between jQuery: text() and html() ?

后端 未结 16 1483
傲寒
傲寒 2020-11-22 03:45

What the difference between text() and html() functions in jQuery ?

$(\"#div\").html(\'Linkhello\         


        
16条回答
  •  太阳男子
    2020-11-22 04:41

    Well in simple term.

    html()-- to get inner html(html tags and text).

    text()-- to get only text if present inside(only text)

提交回复
热议问题