www.webdeveloper.com
Results 1 to 8 of 8

Thread: On Click, Change className of Multiple Elements with the Same className

Threaded View

  1. #1
    Join Date
    Feb 2009
    Posts
    3

    Question onclick="[change all elements with the current class of "x" to a class of "y"]

    Hi,

    Basically, what I am trying to do is this:

    Code:
    <p class="nav_p"><img src="<? nav('Home'); ?>" alt="" /></p>
    <p class="nav_p"><img src="<? nav('e-Portfolio'); ?>" alt="" /></p>
    <p class="nav_p"><img src="<? nav('Blog'); ?>" alt="" /></p>
    <p class="nav_p"><img src="<? nav('About Me'); ?>" alt="" /></p>
    <p class="nav_p"><img src="<? nav('Links'); ?>" alt="" /></p>
    <br />
    <p class="nav_p_small"><img src="<? nav_small('Big'); ?>" alt="" /></p>
    <p class="nav_p_small"><a href="#" onclick="[change all elements with the current class of "nav_p" to a class of "nav_p_small"]><img src="<? nav_small('Small'); ?>" alt="" border="0" /></a></p>
    onclick="[change all elements with the current class of "nav_p" to a class of "nav_p_small"]

    How can I do this? Any help would be very much appreciated.

    Oliver
    Last edited by olylo; 02-13-2009 at 09:14 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles