I have created a wordpress widget. It has a drop down in widget options. The dropdown contains "facebook" and "twitter". If admin selects "twitter", then twitter follower count is displayed inside the widget, similar case for facebook.
The count is displayed inside a div with id "social-count" using jquery. When page loads, jquery ajax will fetch the count and insert it into "social-count".
The problem is that it works fine for single instance. But if 2 instances are added to sidebar, the latest count is shown in both instances as i am using $('.social-count').html(count);
Now how can i assign count to corresponding widget areas using jquery?