How do I store multiple jQuery selectors in a javascript variable?

后端 未结 5 1477
野性不改
野性不改 2021-01-25 12:54

Obviously it\'s a good idea to store jQuery selectors in variables if they are used more than once (not a good idea if used only once).

My question is, how do y

5条回答
  •  面向向阳花
    2021-01-25 13:39

    Why don't you use the easy way.

    var severalVar = 'h1,h2,h3,h4,h5,h6';
     $(severalVar).hide()
    

提交回复
热议问题