View Full Version : How to create and populate a div dynamically?

08-20-2009, 07:29 PM
On the web application tht I am working on there is report page that has variable number of rows and each row has a column that has a link "View Details". When user clicks on the link, a slide-down or a pop-up window should show up displaying a table of info that correspond to the data in the same row. The popup has to be right below the link. Right now all the divs are preloaded on the page which is not a good design. How can I do this dynamically using jQuery? Thanks.

08-21-2009, 06:46 PM
jQuery gives you functions append(), prepend(), after(), before().


These are used along with selectors. So you select the link you want to add the div after, and use the after function.

08-27-2009, 05:35 PM
Thank you very much! :)