"<div id="diva">this is div a</div>"
"<div id="divb"> this is div b</div>"
now how can I change the text of div dynamically by button click. here also mention that all text come from a database. when I click the button then it detects the div id and replace the text with desire text.
All code will be in PHP.
This will work once the page is being loaded:
Dynamically, you would need to do an AJAX call on the PHP file which outputs a value. You’d be better off if you used a JS framework such as jQuery, rather than implementing the AJAX call yourself.