My page has a dropdownlist with three options {1,2,3} and three divs {div1, div2,div3}. I am loading and displaying content of my php array in all the three divs based on few conditions.
When i selected dropdown values, i want the corresponding div to be shown and other to be hidden. eg. if i select drop down option 2, div2 should be shown and div1 and div3 should be hidden.
On page load, I hide div2 and div3 and show only div1. Currently i load the content of all three divs on page load (php foreach loops on the array, whose size is huge) and then control the visibility of divs through javascript. This makes the page load take a lot of time.
Is there a way i can load the contents of divs only on dropdownlist selection? (Please know that its the same php array which populates all div contents, so its already present on the page load)