jquery - javascript replace multiple div tags -


as i'm working on calendar system product integration, want make possible see if there product attached event in calendar.

currently have function opens file , sends id product name, problem if there multiple <div id="productx"></div> (replace x product id) on page, replace first div tag finds.

function getproductname(id){ $.ajax({     type: 'get',     url: 'http://xx.com/api/calendar_getname.php',     data: 'id=' + id,     success: function(data) {         $('#product' + id).html(data);     } }); 

};

is there somehow can make replace multiple of same div tags around page? if finds <div id="product0">x</div> 2 items replace x value get's page.

hope it's understandable @ points.

id unique 1 element, should use class instead , target that

<div class="productx"></div>


Comments

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

Qt4: how to send QString inside a struct via QSharedMemory -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -