Title: Hide div on click with javascript/jquery
Last modified: September 1, 2016

---

# Hide div on click with javascript/jquery

 *  [CliveO](https://wordpress.org/support/users/cliveo/)
 * (@cliveo)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/hide-div-on-click-with-javascriptjquery/)
 * I am trying to hide a div using on click, I got some code from [http://codepen.io/senff/pen/fqmFo](http://codepen.io/senff/pen/fqmFo)
   but I am uncertain if I am using it correctly.
 * I have this:
 *     ```
       <script>// <![CDATA[
       jQuery(document).ready(function(c) {
       	$('.alert-close').on('click', function(c){
       		$(this).parent().fadeOut('slow', function(c){
       		});
       	});
       });
   
       // ]]></script>
       ```
   
 * in the footer and it is supposed to use the div “alert-close” to close the parent
   div which is a div containing a banner ad
 * I just need a simple way to get this script into the footer where the banner 
   ad resides
 * Any ideas? Is there a simple way to drop it into the footer that doesn’t involve
   registering scripts and messing around in functions.php?
 * Thanks in advance

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 9 months ago](https://wordpress.org/support/topic/hide-div-on-click-with-javascriptjquery/#post-7682212)
 * You’ll have to show us your website
 *  Thread Starter [CliveO](https://wordpress.org/support/users/cliveo/)
 * (@cliveo)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/hide-div-on-click-with-javascriptjquery/#post-7682376)
 * I sorted it with this plugin [https://wordpress.org/plugins/itm-simple/](https://wordpress.org/plugins/itm-simple/)
 * Banners at the botton of page (only appear on mobile) can now be closed/dismissed…
   I just need to find a way to make the (x) disappear too now ; )
 * site is: [http://www.footballpunt.com](http://www.footballpunt.com)
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 9 months ago](https://wordpress.org/support/topic/hide-div-on-click-with-javascriptjquery/#post-7682379)
 * What do you mean by the ‘x’
 *  Thread Starter [CliveO](https://wordpress.org/support/users/cliveo/)
 * (@cliveo)
 * [9 years, 9 months ago](https://wordpress.org/support/topic/hide-div-on-click-with-javascriptjquery/#post-7682439)
 * Most pop ups etc. have a little “x” in a circle on the top right corner used 
   to close the pop up. Your browser window is closed with an “x” again usually 
   top right of your browser. See a screenshot of it here [https://i.imgsafe.org/ac902a34ab.jpg](https://i.imgsafe.org/ac902a34ab.jpg)
 * When you click the “x” to close the banner…the “x” remains
 *  [Andrew Nevins](https://wordpress.org/support/users/anevins/)
 * (@anevins)
 * WCLDN 2018 Contributor | Volunteer support
 * [9 years, 9 months ago](https://wordpress.org/support/topic/hide-div-on-click-with-javascriptjquery/#post-7682441)
 * Sorry I don’t see the ‘X’ on Chrome
 *  Thread Starter [CliveO](https://wordpress.org/support/users/cliveo/)
 * (@cliveo)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/hide-div-on-click-with-javascriptjquery/#post-7682468)
 * Strange cos I am using Chrome too. You do see the “x” before clicking to close
   the banner don’t you?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Hide div on click with javascript/jquery’ is closed to new replies.

## Tags

 * [hide div](https://wordpress.org/support/topic-tag/hide-div/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 6 replies
 * 2 participants
 * Last reply from: [CliveO](https://wordpress.org/support/users/cliveo/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/hide-div-on-click-with-javascriptjquery/#post-7682468)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
