You can use .clone()
, like this:
var button_save = $("<button />");
$("#compteurs").append(button_save);
[...]
$("#compteurs").append(button_save.clone());
Related Contents:
- jQuery Ajax File Upload
- What is the best way to detect a mobile device?
- How can I select an element by name with jQuery?
- Format numbers in JavaScript similar to C#
- Scroll Automatically to the Bottom of the Page
- Allow Google Chrome to use XMLHttpRequest to load a URL from a local file
- How can I apply a jQuery function to all elements with the same ID?
- Get index of element as child relative to parent
- How do you cache an image in Javascript
- Remove querystring from URL
- convert 12-hour hh:mm AM/PM to 24-hour hh:mm
- When and why to ‘return false’ in JavaScript?
- Add st, nd, rd and th (ordinal) suffix to a number
- How to pass parameters on onChange of html select
- How do I print part of a rendered HTML page in JavaScript?
- How to solve ‘Redirect has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header’?
- jQuery attr vs prop?
- How do I find out with jQuery if an element is being animated?
- How to get JQuery.trigger(‘click’); to initiate a mouse click
- HTML5 Video Dimensions
- What is the most efficient way to sort an Html Select’s Options by value, while preserving the currently selected item?
- jQuery UI Accordion Expand/Collapse All
- Why is ‘event’ variable available even when not passed as a parameter?
- Detect the Enter key in a text input field
- Get variable name. javascript “reflection”
- How to wait until jQuery ajax request finishes in a loop?
- How to change only text node in element [duplicate]
- Replace only text inside a div using jquery
- Change form values after submit button pressed
- How to prevent ajax requests to follow redirects using jQuery
- :touch CSS pseudo-class or something similar?
- Execute function before refresh
- How can I preserve the search filters in jqGrid on page reload?
- Looping through jQuery Deferreds after all promises have been called
- Loop timer in JavaScript
- jQuery jump or scroll to certain position, div or target on the page from button onclick [duplicate]
- Mozilla firefox not working with window.onbeforeunload
- How do I abort image load requests without using window.stop()
- Jquery getJSON populate select menu question
- Delaying a jquery script until everything else has loaded
- Bootstrap modal: background jumps to top on toggle
- Jquery: how to sleep or delay?
- Check if parent window is iframe or not
- jQuery trigger action when a user scrolls past a certain part of the page
- Jquery Ajax – post huge string value
- How to prevent html/JavaScript code modification
- How to check null objects in jQuery
- How do I validate a date in this format (yyyy-mm-dd) using jquery?
- Clear form after submission with jQuery
- How can I prevent a click on a ‘#’ link from jumping to top of page?