How to close the pop up which is in div tag using jquery on button click





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







-1















Below is my pop up code with close button i need to close the pop up on clicking the close button image how can i do this



<div id="divHeader" class="NewPopHead">
Change Password <a style="margin-top:18px; margin-right:15px; float:right; " class="img Close" id="closebutton"></a>
</div>









share|improve this question























  • Hi Karal. Please take a moment to edit your question and add your own attempts. We'd love to help you fix your code for closing the popup, however you haven't provided any.

    – Tyler Roper
    Jan 4 at 4:48













  • Your <a> tag doesn't have any text inside

    – user1334621
    Jan 4 at 4:50











  • Learn to use the correct element where necessary. Your <a> is not correctly used. I suggested you change to <span>. Also, both <a> and <span> are inline elements and would only show up if you have content in them or there are declared as block elements witb defined width and height.

    – Joshua
    Jan 4 at 5:10




















-1















Below is my pop up code with close button i need to close the pop up on clicking the close button image how can i do this



<div id="divHeader" class="NewPopHead">
Change Password <a style="margin-top:18px; margin-right:15px; float:right; " class="img Close" id="closebutton"></a>
</div>









share|improve this question























  • Hi Karal. Please take a moment to edit your question and add your own attempts. We'd love to help you fix your code for closing the popup, however you haven't provided any.

    – Tyler Roper
    Jan 4 at 4:48













  • Your <a> tag doesn't have any text inside

    – user1334621
    Jan 4 at 4:50











  • Learn to use the correct element where necessary. Your <a> is not correctly used. I suggested you change to <span>. Also, both <a> and <span> are inline elements and would only show up if you have content in them or there are declared as block elements witb defined width and height.

    – Joshua
    Jan 4 at 5:10
















-1












-1








-1








Below is my pop up code with close button i need to close the pop up on clicking the close button image how can i do this



<div id="divHeader" class="NewPopHead">
Change Password <a style="margin-top:18px; margin-right:15px; float:right; " class="img Close" id="closebutton"></a>
</div>









share|improve this question














Below is my pop up code with close button i need to close the pop up on clicking the close button image how can i do this



<div id="divHeader" class="NewPopHead">
Change Password <a style="margin-top:18px; margin-right:15px; float:right; " class="img Close" id="closebutton"></a>
</div>






jquery






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 4 at 4:47









karal kunalkaral kunal

36




36













  • Hi Karal. Please take a moment to edit your question and add your own attempts. We'd love to help you fix your code for closing the popup, however you haven't provided any.

    – Tyler Roper
    Jan 4 at 4:48













  • Your <a> tag doesn't have any text inside

    – user1334621
    Jan 4 at 4:50











  • Learn to use the correct element where necessary. Your <a> is not correctly used. I suggested you change to <span>. Also, both <a> and <span> are inline elements and would only show up if you have content in them or there are declared as block elements witb defined width and height.

    – Joshua
    Jan 4 at 5:10





















  • Hi Karal. Please take a moment to edit your question and add your own attempts. We'd love to help you fix your code for closing the popup, however you haven't provided any.

    – Tyler Roper
    Jan 4 at 4:48













  • Your <a> tag doesn't have any text inside

    – user1334621
    Jan 4 at 4:50











  • Learn to use the correct element where necessary. Your <a> is not correctly used. I suggested you change to <span>. Also, both <a> and <span> are inline elements and would only show up if you have content in them or there are declared as block elements witb defined width and height.

    – Joshua
    Jan 4 at 5:10



















Hi Karal. Please take a moment to edit your question and add your own attempts. We'd love to help you fix your code for closing the popup, however you haven't provided any.

– Tyler Roper
Jan 4 at 4:48







Hi Karal. Please take a moment to edit your question and add your own attempts. We'd love to help you fix your code for closing the popup, however you haven't provided any.

– Tyler Roper
Jan 4 at 4:48















Your <a> tag doesn't have any text inside

– user1334621
Jan 4 at 4:50





Your <a> tag doesn't have any text inside

– user1334621
Jan 4 at 4:50













Learn to use the correct element where necessary. Your <a> is not correctly used. I suggested you change to <span>. Also, both <a> and <span> are inline elements and would only show up if you have content in them or there are declared as block elements witb defined width and height.

– Joshua
Jan 4 at 5:10







Learn to use the correct element where necessary. Your <a> is not correctly used. I suggested you change to <span>. Also, both <a> and <span> are inline elements and would only show up if you have content in them or there are declared as block elements witb defined width and height.

– Joshua
Jan 4 at 5:10














2 Answers
2






active

oldest

votes


















0














Since you are using jQuery.
$("#closebutton").on("click", function(e) { $("YOUR POP UP DIV").hide() })






share|improve this answer
























  • I had already tried this $("#closebutton").on("click", function (e) { debugger; $("divHeader").hide() }) but its not working

    – karal kunal
    Jan 4 at 5:17













  • it should be $("#divHeader") instead of $("divHeader"), you are missing a hash. Check out jQuery selector first if you are not familiar with targeting class or id.

    – Speir
    Jan 6 at 0:59











  • Also, you should paste HTML code here as well. Otherwise, people will not understand your question comprehensively.

    – Speir
    Jan 6 at 1:02



















0














Edited



Target the parent element of the close button and hide using jquery hide method.



$("#closebutton").on("click", function(e) { $(this).parent().hide() })





share|improve this answer


























  • I am getting this error Uncaught TypeError: e.parent is not a function

    – karal kunal
    Jan 4 at 5:21











  • I have edited the answer, it should be $(this).parent().hide()

    – Joshua
    Jan 4 at 5:25











  • still i am facing same issue as VM1635:1 Uncaught TypeError: e.parent is not a function

    – karal kunal
    Jan 4 at 5:28











  • Please copy the right code.

    – Joshua
    Jan 4 at 5:29











  • the pop up is getting hided but after closing the pop up background screen is getting faded which is not allowing the user to do any operations

    – karal kunal
    Jan 4 at 5:55












Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54033250%2fhow-to-close-the-pop-up-which-is-in-div-tag-using-jquery-on-button-click%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Since you are using jQuery.
$("#closebutton").on("click", function(e) { $("YOUR POP UP DIV").hide() })






share|improve this answer
























  • I had already tried this $("#closebutton").on("click", function (e) { debugger; $("divHeader").hide() }) but its not working

    – karal kunal
    Jan 4 at 5:17













  • it should be $("#divHeader") instead of $("divHeader"), you are missing a hash. Check out jQuery selector first if you are not familiar with targeting class or id.

    – Speir
    Jan 6 at 0:59











  • Also, you should paste HTML code here as well. Otherwise, people will not understand your question comprehensively.

    – Speir
    Jan 6 at 1:02
















0














Since you are using jQuery.
$("#closebutton").on("click", function(e) { $("YOUR POP UP DIV").hide() })






share|improve this answer
























  • I had already tried this $("#closebutton").on("click", function (e) { debugger; $("divHeader").hide() }) but its not working

    – karal kunal
    Jan 4 at 5:17













  • it should be $("#divHeader") instead of $("divHeader"), you are missing a hash. Check out jQuery selector first if you are not familiar with targeting class or id.

    – Speir
    Jan 6 at 0:59











  • Also, you should paste HTML code here as well. Otherwise, people will not understand your question comprehensively.

    – Speir
    Jan 6 at 1:02














0












0








0







Since you are using jQuery.
$("#closebutton").on("click", function(e) { $("YOUR POP UP DIV").hide() })






share|improve this answer













Since you are using jQuery.
$("#closebutton").on("click", function(e) { $("YOUR POP UP DIV").hide() })







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 4 at 4:50









SpeirSpeir

342214




342214













  • I had already tried this $("#closebutton").on("click", function (e) { debugger; $("divHeader").hide() }) but its not working

    – karal kunal
    Jan 4 at 5:17













  • it should be $("#divHeader") instead of $("divHeader"), you are missing a hash. Check out jQuery selector first if you are not familiar with targeting class or id.

    – Speir
    Jan 6 at 0:59











  • Also, you should paste HTML code here as well. Otherwise, people will not understand your question comprehensively.

    – Speir
    Jan 6 at 1:02



















  • I had already tried this $("#closebutton").on("click", function (e) { debugger; $("divHeader").hide() }) but its not working

    – karal kunal
    Jan 4 at 5:17













  • it should be $("#divHeader") instead of $("divHeader"), you are missing a hash. Check out jQuery selector first if you are not familiar with targeting class or id.

    – Speir
    Jan 6 at 0:59











  • Also, you should paste HTML code here as well. Otherwise, people will not understand your question comprehensively.

    – Speir
    Jan 6 at 1:02

















I had already tried this $("#closebutton").on("click", function (e) { debugger; $("divHeader").hide() }) but its not working

– karal kunal
Jan 4 at 5:17







I had already tried this $("#closebutton").on("click", function (e) { debugger; $("divHeader").hide() }) but its not working

– karal kunal
Jan 4 at 5:17















it should be $("#divHeader") instead of $("divHeader"), you are missing a hash. Check out jQuery selector first if you are not familiar with targeting class or id.

– Speir
Jan 6 at 0:59





it should be $("#divHeader") instead of $("divHeader"), you are missing a hash. Check out jQuery selector first if you are not familiar with targeting class or id.

– Speir
Jan 6 at 0:59













Also, you should paste HTML code here as well. Otherwise, people will not understand your question comprehensively.

– Speir
Jan 6 at 1:02





Also, you should paste HTML code here as well. Otherwise, people will not understand your question comprehensively.

– Speir
Jan 6 at 1:02













0














Edited



Target the parent element of the close button and hide using jquery hide method.



$("#closebutton").on("click", function(e) { $(this).parent().hide() })





share|improve this answer


























  • I am getting this error Uncaught TypeError: e.parent is not a function

    – karal kunal
    Jan 4 at 5:21











  • I have edited the answer, it should be $(this).parent().hide()

    – Joshua
    Jan 4 at 5:25











  • still i am facing same issue as VM1635:1 Uncaught TypeError: e.parent is not a function

    – karal kunal
    Jan 4 at 5:28











  • Please copy the right code.

    – Joshua
    Jan 4 at 5:29











  • the pop up is getting hided but after closing the pop up background screen is getting faded which is not allowing the user to do any operations

    – karal kunal
    Jan 4 at 5:55
















0














Edited



Target the parent element of the close button and hide using jquery hide method.



$("#closebutton").on("click", function(e) { $(this).parent().hide() })





share|improve this answer


























  • I am getting this error Uncaught TypeError: e.parent is not a function

    – karal kunal
    Jan 4 at 5:21











  • I have edited the answer, it should be $(this).parent().hide()

    – Joshua
    Jan 4 at 5:25











  • still i am facing same issue as VM1635:1 Uncaught TypeError: e.parent is not a function

    – karal kunal
    Jan 4 at 5:28











  • Please copy the right code.

    – Joshua
    Jan 4 at 5:29











  • the pop up is getting hided but after closing the pop up background screen is getting faded which is not allowing the user to do any operations

    – karal kunal
    Jan 4 at 5:55














0












0








0







Edited



Target the parent element of the close button and hide using jquery hide method.



$("#closebutton").on("click", function(e) { $(this).parent().hide() })





share|improve this answer















Edited



Target the parent element of the close button and hide using jquery hide method.



$("#closebutton").on("click", function(e) { $(this).parent().hide() })






share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 4 at 5:24

























answered Jan 4 at 5:13









JoshuaJoshua

1275




1275













  • I am getting this error Uncaught TypeError: e.parent is not a function

    – karal kunal
    Jan 4 at 5:21











  • I have edited the answer, it should be $(this).parent().hide()

    – Joshua
    Jan 4 at 5:25











  • still i am facing same issue as VM1635:1 Uncaught TypeError: e.parent is not a function

    – karal kunal
    Jan 4 at 5:28











  • Please copy the right code.

    – Joshua
    Jan 4 at 5:29











  • the pop up is getting hided but after closing the pop up background screen is getting faded which is not allowing the user to do any operations

    – karal kunal
    Jan 4 at 5:55



















  • I am getting this error Uncaught TypeError: e.parent is not a function

    – karal kunal
    Jan 4 at 5:21











  • I have edited the answer, it should be $(this).parent().hide()

    – Joshua
    Jan 4 at 5:25











  • still i am facing same issue as VM1635:1 Uncaught TypeError: e.parent is not a function

    – karal kunal
    Jan 4 at 5:28











  • Please copy the right code.

    – Joshua
    Jan 4 at 5:29











  • the pop up is getting hided but after closing the pop up background screen is getting faded which is not allowing the user to do any operations

    – karal kunal
    Jan 4 at 5:55

















I am getting this error Uncaught TypeError: e.parent is not a function

– karal kunal
Jan 4 at 5:21





I am getting this error Uncaught TypeError: e.parent is not a function

– karal kunal
Jan 4 at 5:21













I have edited the answer, it should be $(this).parent().hide()

– Joshua
Jan 4 at 5:25





I have edited the answer, it should be $(this).parent().hide()

– Joshua
Jan 4 at 5:25













still i am facing same issue as VM1635:1 Uncaught TypeError: e.parent is not a function

– karal kunal
Jan 4 at 5:28





still i am facing same issue as VM1635:1 Uncaught TypeError: e.parent is not a function

– karal kunal
Jan 4 at 5:28













Please copy the right code.

– Joshua
Jan 4 at 5:29





Please copy the right code.

– Joshua
Jan 4 at 5:29













the pop up is getting hided but after closing the pop up background screen is getting faded which is not allowing the user to do any operations

– karal kunal
Jan 4 at 5:55





the pop up is getting hided but after closing the pop up background screen is getting faded which is not allowing the user to do any operations

– karal kunal
Jan 4 at 5:55


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54033250%2fhow-to-close-the-pop-up-which-is-in-div-tag-using-jquery-on-button-click%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas