Reputation: 34198
Suppose that I have many DIV
s with different ID
s and I want to insert a small snippet of html into all of those DIV
s with different ID
s. I tried
$("#lblTopPager", "#lblBottomPager").html('hello my data');
but it doesn't work. Can anyone tell me the correct way to do it?
Upvotes: 0
Views: 78
Reputation: 318302
Elements need to be a comma seperated list, right now you are giving context, and basically looking for an element with the ID lblTopPager
inside the element with ID lblBottomPager
, just as if you where using $('#lblBottomPager').find('#lblTopPager')
.
To target two or more elements at the same time you could do :
$("#lblTopPager, #lblBottomPager").html('hello my data');
Upvotes: 1