Soldato
So I have a PHP script that generates a bunch of <div> tags with random ID attributes e.g.
with these ID's based upon an ID reference within a Database. I want when a button is clicked (dynamically generated again) to refresh a specific <div> tag using an Ajax call.
Now my JS skills are pretty crap (I'm mainly backend) but I can do standard Ajax Calls. However, since the ID's are dynamically generated both on the button with the onclick() event and the <div> tags to refresh, I'm unsure on how to do this.
Is there a way to either do an Ajax call for the onclick() element and the <div> tag using variables in the name?
Or do I need to do something like dynamically generated the JS file?
Or if anybody could give me advice on how best to describe this to google it?
HTML:
<div id="#UserMoreInfo-123456-Modal">
<!-- some stuff-->
</div>
<div id="#UserMoreInfo-234567-Modal">
<!-- some stuff-->
</div>
<div id="#UserMoreInfo-345678-Modal">
<!-- some stuff-->
</div>
with these ID's based upon an ID reference within a Database. I want when a button is clicked (dynamically generated again) to refresh a specific <div> tag using an Ajax call.
Now my JS skills are pretty crap (I'm mainly backend) but I can do standard Ajax Calls. However, since the ID's are dynamically generated both on the button with the onclick() event and the <div> tags to refresh, I'm unsure on how to do this.
Is there a way to either do an Ajax call for the onclick() element and the <div> tag using variables in the name?
Or do I need to do something like dynamically generated the JS file?
Or if anybody could give me advice on how best to describe this to google it?