$('') vs $('') in jQuery

后端 未结 6 736
暗喜
暗喜 2020-11-29 13:10

I see people creating HTML elements in jQuery in two different ways:

$(\'\')

and

$(\'\') 
<         


        
6条回答
  •  隐瞒了意图╮
    2020-11-29 13:40

    A shorthand element requires a slash because its replacing . So you'd write that wherever appropriate for the sake of valid markup. But its not required to be one way or another.

    Edited: this is not actually the problem. others here seem to agree that its a matter of regex performance

提交回复
热议问题