What does the selector syntax mean in $( “
” ).text( message )

前端 未结 6 1614
旧巷少年郎
旧巷少年郎 2021-01-03 15:50

What does the selector

syntax mean in this code? I\'ve seen selectors like div or #someId but I\'m confused what the
6条回答
  •  清酒与你
    2021-01-03 16:01

    It means that the jquery function will not actually query for DIV elements but will create an jquery wrapped element of type

    on which you can work on and append to the DOM eventually.

    In your case, the code will create jquery object representing a DIV element, set its innerText to what the message variable contains and prepend it to the element with ID "log".

提交回复
热议问题