Click to See Complete Forum and Search --> : Replace text and action onclick


igotosleepat2
07-31-2008, 11:12 AM
Hi,

I live this link here that starts and stops a slideshow
<li id="slideshowstart"><a href="#" onclick="imgs.apStart(2); return false;"><?= $text['start'] ?></a></li>

After clicking it, i would like it to change text and function and id and become
<li id="slideshowstop"><a href="#" onclick="imgs.apStop(); return false;"><?= $text['stop'] ?></a></li>

How do i accomplish that?

A1ien51
07-31-2008, 05:06 PM
Why do you want to change the id?

How about you hide the one li element and show the other?


document.getElementById('slideshowstart').display = 'none';
document.getElementById('slideshowstop').display = '';


Eric