I need the alternative for the click() method that will work in the
latest FireFox and Netscape browsers. I have found postings like the
one below, but I can't seem to make it work.
I have a tree menu that I store the levels in a cookie, when the user
returns, I read the level values out of the cookie so the tree is in
its' former state. I need to know how to programmaticall y click
document.getEle mentsByTagName( 'LI')[lev1]
Any help or pointers appreciated. - John
//Returns tree to previous state. Cookie only held for browser
session.
function setTreeVals(){
//checks for TreeVals existence
if(document.coo kie.indexOf('Tr eeVals') > -1){
var levels=getSecti on('TreeVals');
var lev1=levels.spl it('|')[0]
var lev2=levels.spl it('|')[1]
var lev3=levels.spl it('|')[2]
var lev4=levels.spl it('|')[3]
//opens tree
if(lev1)
document.getEle mentsByTagName( 'LI')[lev1].click();
if(lev2)
document.getEle mentsByTagName( 'LI')[lev2].click();
if(lev3)
document.getEle mentsByTagName( 'LI')[lev3].click();
if(lev4)
document.getEle mentsByTagName( 'LI')[lev4].click();
}
}
latest FireFox and Netscape browsers. I have found postings like the
one below, but I can't seem to make it work.
I have a tree menu that I store the levels in a cookie, when the user
returns, I read the level values out of the cookie so the tree is in
its' former state. I need to know how to programmaticall y click
document.getEle mentsByTagName( 'LI')[lev1]
Any help or pointers appreciated. - John
//Returns tree to previous state. Cookie only held for browser
session.
function setTreeVals(){
//checks for TreeVals existence
if(document.coo kie.indexOf('Tr eeVals') > -1){
var levels=getSecti on('TreeVals');
var lev1=levels.spl it('|')[0]
var lev2=levels.spl it('|')[1]
var lev3=levels.spl it('|')[2]
var lev4=levels.spl it('|')[3]
//opens tree
if(lev1)
document.getEle mentsByTagName( 'LI')[lev1].click();
if(lev2)
document.getEle mentsByTagName( 'LI')[lev2].click();
if(lev3)
document.getEle mentsByTagName( 'LI')[lev3].click();
if(lev4)
document.getEle mentsByTagName( 'LI')[lev4].click();
}
}
Comment