How to clear effect of a click button using jquery

Vivek Kumar

I am doing something as shown bellow:

$("#btn1").click(function(){
    $('<div></div>').appendTo('body');
});

It appends the division again and again when I click it, but what I want is when I click other button then there should be no effect of "btn1" means I want to clear the effect of first button after I click the second one.

How I can do this?

ColinE

Why not add a class to the div that btn1 adds:

$("#btn1").click(function() {
    $("<div class='new-div'></div>").appendTo('body');
});

Then you second button can remove it like so -

$("#btn2").click(function() {
    $(".new-div").remove();
});

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to clear effect of a click button using jquery

From Dev

How to clear textbox on click button

From Dev

How to add a click effect to a button on click event?

From Dev

How To Remove Textbox Using Jquery On Button Click

From Dev

How to Trigger an event on button click using jQuery

From Dev

How to dynamically add clear button for each value using jquery?

From Dev

how to move a button and see it with effect/animation methods using jquery?

From Dev

How to enable and disable button when click checkbox button using JQuery

From Dev

move an element from one div to another div with animate effect on button click using html and jquery

From Dev

fadeIn effect for HTML files using jQuery on click

From Dev

Programmatically click a button using jquery

From Dev

Programmatically click a button using jquery

From Dev

Click Gridview button using jQuery

From Dev

How to select filtered results on a button click from datatable using jquery

From Dev

How to render specific page template using jquery button click

From Dev

How to get the count of checked rows of a table on a button click using jQuery?

From Dev

How to update data into each row when click on button using Jquery?

From Dev

How to scrape data in a page with jquery button click using HtmlAgility pack

From Dev

How to append child div into a parent div using jquery on the click of a button

From Dev

How to change class of focused contenteditable element on button click using jquery?

From Dev

How to lanuch a post using javascript or jquery when I click a button?

From Dev

how to filter data in a table on button click using jquery

From Dev

How to click a button that doesn't have an ID using jQuery/JS

From Dev

how do i clear jquery click functions

From Dev

how do i clear jquery click functions

From Dev

How to clear the button color when i click next button?

From Dev

"Click" effect on a customized button

From Dev

How to remove 'press button' effect and make button flat even on click

From Dev

How handle button click jquery

Related Related

  1. 1

    How to clear effect of a click button using jquery

  2. 2

    How to clear textbox on click button

  3. 3

    How to add a click effect to a button on click event?

  4. 4

    How To Remove Textbox Using Jquery On Button Click

  5. 5

    How to Trigger an event on button click using jQuery

  6. 6

    How to dynamically add clear button for each value using jquery?

  7. 7

    how to move a button and see it with effect/animation methods using jquery?

  8. 8

    How to enable and disable button when click checkbox button using JQuery

  9. 9

    move an element from one div to another div with animate effect on button click using html and jquery

  10. 10

    fadeIn effect for HTML files using jQuery on click

  11. 11

    Programmatically click a button using jquery

  12. 12

    Programmatically click a button using jquery

  13. 13

    Click Gridview button using jQuery

  14. 14

    How to select filtered results on a button click from datatable using jquery

  15. 15

    How to render specific page template using jquery button click

  16. 16

    How to get the count of checked rows of a table on a button click using jQuery?

  17. 17

    How to update data into each row when click on button using Jquery?

  18. 18

    How to scrape data in a page with jquery button click using HtmlAgility pack

  19. 19

    How to append child div into a parent div using jquery on the click of a button

  20. 20

    How to change class of focused contenteditable element on button click using jquery?

  21. 21

    How to lanuch a post using javascript or jquery when I click a button?

  22. 22

    how to filter data in a table on button click using jquery

  23. 23

    How to click a button that doesn't have an ID using jQuery/JS

  24. 24

    how do i clear jquery click functions

  25. 25

    how do i clear jquery click functions

  26. 26

    How to clear the button color when i click next button?

  27. 27

    "Click" effect on a customized button

  28. 28

    How to remove 'press button' effect and make button flat even on click

  29. 29

    How handle button click jquery

HotTag

Archive