1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Remove DIV after click on it

Discussion in 'HTML & JavaScript' started by meCODEX, Nov 3, 2015.

  1. meCODEX

    meCODEX Registered Member

    Joined:
    Jun 23, 2011
    Messages:
    77
    Likes Received:
    9
    When an visitor enter on my page he get a popup .
    How can i use java or jquery to remove that popup/div after he click on my ad that appear on popup ?

    Or let's say I have and AD inside a <div>, how can i remove make that AD disappear after he click inside <div> ( inside div not on ad )


    Thanks! :)
     
  2. sturose

    sturose Jr. VIP Jr. VIP

    Joined:
    Nov 6, 2013
    Messages:
    1,548
    Likes Received:
    1,915
    Gender:
    Male
    Occupation:
    Clicking my own adverts
    Location:
    Stuck in a rut
    Some possible solutions on stackoverflow HERE

    Is that the type of thing you are looking for? DEMO HERE
     
  3. etiohhpasdfaef

    etiohhpasdfaef Newbie Premium Member

    Joined:
    Nov 3, 2015
    Messages:
    20
    Likes Received:
    0
    You can try what I found googleing:

    Code:
    <div id="clients-edit-wrapper">
        <div class="close-wrapper">
            <a href="#" class="close-div">Close</a>
        </div>
    </div>
    
    $('.close-div').click(function(){
       $(this).parent().parent().remove();
    });
     
  4. zotohost

    zotohost Registered Member

    Joined:
    Oct 25, 2015
    Messages:
    71
    Likes Received:
    4
    You can hide DIV with JS

    Code:
    <div id="myDiv" onClick="javascript:this.style.display='none';">
     
    </div>
    
     
  5. meCODEX

    meCODEX Registered Member

    Joined:
    Jun 23, 2011
    Messages:
    77
    Likes Received:
    9
    Ooo thank you guys.
    I'm gonna try and i'll be back with a response :)