Jump to content


Photo

jquery onclick


  • Please log in to reply
1 reply to this topic

#1 mankeluvsit

mankeluvsit

    Young Padawan

  • Members
  • Pip
  • 4 posts

Posted 31 January 2010 - 10:26 PM

im trying to figure out how to close a certain "div" when clicked using js.
like this

<div class="CLOSE">information</div>

any class with the class "close" will be closed.

any help would be appreciated, ive seen many sites do it. i just cant find out jow

#2 NGPixel

NGPixel

    Senior Programmer

  • P2L Staff
  • PipPipPipPip
  • 1,410 posts
  • Gender:Male
  • Location:Montreal, Canada
  • Interests:Web Design : Coding : Animation

Posted 01 February 2010 - 09:59 AM

$('.close').click(function() {
	$(this).hide();
});

By "close", I guess you mean hide the element. The above code will hide the div when clicked.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users