www.webdeveloper.com
Results 1 to 2 of 2

Thread: Click modifies another div class

  1. #1
    Join Date
    Sep 2003
    Location
    Bridgeport, CT USA
    Posts
    12

    Click modifies another div class

    I am an intermediate JSer with some success. What I want to do seems simple, but I can't grab onto it.

    I want a click in "first" to modify opacity in "second"

    <div class="first" onClick="i want code here to toggle opacity for class 'second'">image here</div>

    <div class="second">This the div I want to change opacity in</div>


    Yes, I know the proper CSS for declaring opacity. I just can't seem to find the right "call."

    Any help would be muchly appreciated.
    Ace in CT

  2. #2
    Join Date
    Dec 2005
    Location
    FL
    Posts
    7,373

    Lightbulb Consider these changes ...

    Consider this change ...
    Code:
    <div class="first" onClick="document.getElementById('secondID').style.opacity=xxx">image here</div>
    
    <div id="secondID" class="second">This the div I want to change opacity in</div>

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