i need to simulated having clicked on a link with JavaScript. As you will see in my stripped down example the resulting function from the click is a window.addEvent () action. Thanks for the help.
js code -
html code -
i have tried this but id didnt work -
What is the code to make the window.addEvent () fire? *expand* must be part of it. Thank you.
js code -
Code:
window.addEvent('domready', function() {
expandCollapse();
}
function expandCollapse(){
$('expand').addEvent('click', function(){
// do something
}
}
Code:
<a id="expand" href="javascript:void(0);">open all</a>
Code:
document.getElementById('expand').click();
Comment