Jump to content

Jquery help

- - - - -

  • Please log in to reply
1 reply to this topic

#1
ahmed

ahmed

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 304 posts
I am making something like this
Tryit Editor v1.4

I want to add a thing in it i.e when i click the button , the text should be hidden again .
Can anyone help me out ?

#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Well, that tutorial is made for ajax loading... not really a good context to go hide/show stuff.

<script type=[B][COLOR="#008000"]"text/javascript"[/COLOR][/B]>

var visible = true;


$(document).ready(function(){

  $([B][COLOR="#008000"]"button"[/COLOR][/B]).click(function(){

    [B][COLOR="#000080"]if[/COLOR][/B]($([B][COLOR="#008000"]"div"[/COLOR][/B]).is(':visible')){

       $([B][COLOR="#008000"]"div"[/COLOR][/B]).hide();

    }[B][COLOR="#000080"]else[/COLOR][/B] {

       $([B][COLOR="#008000"]"div"[/COLOR][/B]).show();

    }

  });

});

</script>





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users