Tempusfugit UK

Firing a Javascript from a Button or Menu option

The aim here is to incorporate the functionality of an expandable section on a web page with the clicking of a menu option.

I am thinking that this is going to require quite a bit of Javascript, something that I don't quite understand at the moment. I need to identify the "panel" to expand and then have function to expand it. The code for the accordian button is contained in the actual button

DOM - Document Object Model

"The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."

2 buttons are created (in the class="accordion") - the text is not what appears below

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

And then 2 scripts one that sets text and the second to expand the pane; associated with the accordion button. They are identifing by id.

What I really want to do is to "click" the buttons.

Firing a Javascript from a Button or Menu option