How to use variable in string in jQuery

后端 未结 7 2015
陌清茗
陌清茗 2020-12-08 23:28

I want to use a variable in a string. I have tried to do it many times, but it is only getting the variable name.


    

        
7条回答
  •  独厮守ぢ
    2020-12-08 23:42

    You can also use template literals:

    $('.html').html(`
    jitender
    `)

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

提交回复
热议问题