I am in need of assistance to create a dynamic grid using jQuery Mobile. The grid should consist of buttons with either 'onclick' or 'href' functionality. The number of buttons should be generated dynamically at runtime. Specifically, I would like this grid to resemble a library index. When a library button is clicked, it should display the names of books in a new grid of buttons. Upon clicking a book name button, it should then display another grid containing chapter numbers for that book. These grids should all be created dynamically based on user selections.
<div class="ui-grid-d" id="book_chooser">
<div class="ui-block-a"><button class="ui-bar ui-bar-a" style="height:30px">Book A</button></div>
<div class="ui-block-b"><button class="ui-bar ui-bar-a" style="height:30px">Book B</button></div>
<div class="ui-block-c"><button class="ui-bar ui-bar-a" style="height:30px">Book C</button></div>
<div class="ui-block-d"><button class="ui-bar ui-bar-a" style="height:30px">Book D</button></div>
<div class="ui-block-e"><button class="ui-bar ui-bar-a" style="height:30px">Book E</button></div>
The grid of buttons needs to be generated dynamically during runtime based on the number of books available in the library.
I am utilizing jQuery, JavaScript, and HTML5 with the PhoneGap plugin for this project.
Any help or guidance is greatly appreciated!
Thank you in advance.