+ Post New Thread
Results 1 to 3 of 3

Thread: Javascript - click to hide/show text/content

  1. #1
    Administrator
    Join Date
    Mar 2013
    Posts
    2,723

    Javascript - click to hide/show text/content

    Hello, do You know any effective and simple javascript code which allows showing/hiding some webpage content on click?

    so far i found this one:
    Code:
    <script>
    function showhide(idecko){
    el=document.getElementById(idecko).style; 
    el.display=(el.display == 'block')?'none':'block';
    }
    </script>
    <style>.hidden {display: none}</style>
    <span style="cursor: pointer; cursor: hand;" onclick="showhide('oddil1')">Click me to show/hide</span>
    <div id="oddil1" class="hidden">Hidden text here</div>
    and it works. By default, text is hidden, when one click it is shown, when click again, it is hidden

  2. #2
    Junior Member NancyHolmes's Avatar
    Join Date
    Jul 2019
    Location
    California
    Posts
    25
    I suggest you to Google free code camp .
    This will definitely help you.

  3. #3
    This script seems very difficult to me. Can anybody help me with it?

+ Post New Thread

Similar Threads

  1. Replies: 0
    Last Post: 12-18-2015, 12:08 PM
  2. Replies: 0
    Last Post: 09-09-2015, 11:32 AM
  3. Replies: 0
    Last Post: 12-04-2014, 05:00 PM
  4. Replies: 0
    Last Post: 11-14-2014, 12:48 AM
  5. Replies: 0
    Last Post: 11-12-2014, 02:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam