Monday, 6 February 2017

jquery to show and hide div content - easy method

Here is a simple script using jQuery library to hide and show the div content. We are using built in function toggle() and if condition to show and hide the content respectively.

<!DOCTYPE html>
<script src=""></script>
    $('.hidden', this).toggle();
        $('.Add p').text("- close content");
        $('.Add p').text("+ Open content"); 
<div class="Add">
    + Open content
    <div class='hidden' style="display:none;">Here goes your hidden content</div>

Try Output Here :

+ Open content

No comments:
Write comments

Featured post

List of Universities in Karnataka offering M.Sc Computer Science

The post-graduate programme in Computer Science (M.Sc Computer Science) contains two academic years duration and having a four semesters....

Popular Posts

Copyright @ 2011-2016