I'm trying to create a div that expands when clicked to reveal its content. I've taken the following steps so far:
- Established a div with overflow:hidden property
- Developed a JavaScript function that switches between a "minimized" and "maximized" height for the div (20px height and XYZpx height).
Although everything is functioning correctly, I'm unsure of how to determine the height of the content inside the div in order to resize it accordingly. Essentially, I have hidden content that extends beyond the 20px "minimized" div, and while I can expand the div to expose the overflowing content, I don't know by what amount to adjust it.
Do you have any suggestions on how I could address this issue?
Thank you in advance!