亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

How to update dom element selected by jquery?
女神的閨蜜愛上我
女神的閨蜜愛上我 2017-07-05 10:43:06
0
3
918

For example, there is
<p class="ape">Element 1</p>
I use jquery to cache it into a variable:

var $ape = $('.ape');

Then I added a new one
<p class="ape">Element 2</p>
What method should $ape use to refresh itself at this time? How to enable it to select two apes at the same time?
I don’t want to have to $('.ape') every time I call it, I just want to call the cached variable $ape

女神的閨蜜愛上我
女神的閨蜜愛上我

reply all(3)
學(xué)習(xí)ing

The only way is to assign the value to $ape again every time an element is added

淡淡煙草味

It is recommended to use $('.ape') directly. Don't write code exactly according to your own wishes, try to adapt your code to the grammatical features. The code written this way is more valuable.

Ty80

Either reassign the value, or when inserting a node, trigger an event and reassign the value. Anyway, it’s just reassignment

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template