Q:

update html content in all duplicate id's Jquery

I am trying to update the HTML content inside div using jquery HTML function.
<div id="test"></div>
.
.
.
<div id = "test" style="display:none"></div>'

When I am updating the content.
 (#test).html(result)

I need to update both the div .How can I achieve this.
Thanks

A:

ID must be unique, you should use class instead
<div class="test" id="test1"></div>
<div class="test" id="test2"></div>

$('div.test')
.html('<p>All new content.You want!</p>');

