To load DIVs one by one, define a counter
var curDiv = 1;
somewhere in the beginning (it is better to define the function $(document).ready() to initialize it). Define this function:
function loadThing() { if (curDiv<5) $('#mainContainer').load('loadpage.html #nav' + (curDiv++) + 'div'); }
Define the click event as:
$("input#getdiv").click(loadThing);
and you press the button:
<input id="getdiv" type="button" value="Details" />
Each time you click, you should get the first div, second, etc.
With this approach, you extract JS from HTML, which is always good.
Cranio
source share