set text in jquery

前端 未结 4 992
借酒劲吻你
借酒劲吻你 2021-02-03 20:20

If I want to set the text of a

to \"Test message here\", do I do:

 $(\'
\').text(\'Test
4条回答
  •  后悔当初
    2021-02-03 20:59

    It's preferable to use

    $("#error").html('Test message here') 
    

    instead of simply

    .text('Text Msg');
    

提交回复
热议问题