Answers for "clear div jquery"

1

how To clear all the input element inside div using jquery

By LOVE
$('#divStaffContent').find('input:text, input:password, select')
                    .each(function () {
                        $(this).val('');
                    });
                }
Posted by: Guest on May-07-2020
3

how to remove html element in jquery

$("button").click(function(){
  $("p").remove();
});
Posted by: Guest on November-24-2020
1

reset div jquery

/* Answer to: "reset div jquery" */

var originalState = $("#some_div").html();
$("#some_div").html(originalState);

/*
  Check here (source) for more information and potentially better solutions:
  https://stackoverflow.com/questions/5557641/how-can-i-reset-div-to-its-original-state-after-it-has-been-modified-by-java
*/
Posted by: Guest on June-07-2021
2

jquery clear text in div

// removes only text, no changes to children
$('#YourDivId').contents().filter((_, el) => el.nodeType === 3).remove();
Posted by: Guest on September-01-2020
0

jquery if empty remove div

//if empty remove parent
$('#id:empty').parent().remove();
Posted by: Guest on August-07-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language