show hide classes

HTML Code:

<script type="text/javascript">
    <!--
    var mode;
    function show(mode) {
            if (mode == 'approved') {
            document.approvedno.style.visibility = "hidden";
            alert('hidden');
            }
   
            if (mode == 'all') {
            document.approvedno.style.visibility = "visible";
            alert('shown');
            }
    }
    //-->

</script>

show:
<a style="cursor: pointer;" onclick="javascript:show('all')">all</a>
<a style="cursor: pointer;" onclick="javascript:show('approved')">approved</a>

<div class="approvedno" style="visibility: visible;">hide me</div>
<div class="approvedyes" style="visibility: visible;">don't hide me</div>
<div class="approvedno" style="visibility: hidden;">hide me</div>
<div class="approvedyes" style="visibility: hidden;">don't hide me</div>


I want to click a button and then change the style of all elements with a certain class. it’s not working.

View full post on Tycoon Talk

, ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Get Adobe Flash playerPlugin by wpburn.com wordpress themes


RSS Site FeedRSS Site Feed

© 1992-2011 DC2NET™, Inc. All Rights Reserved