How to remove prior appendAfter text?
In the code below, the
div#popupText retains the prior insertions. Is there a method to Clear the div? empty() does not work...even if I place it before each appendAfter();
Stumped...
Todd
- $("div#popupText").empty();
- if (popupName == "showPopup1") {
- $( $("div#text1").html() ).insertAfter("div#popupText");
- } else if (popupName == "showPopup2") {
- $( $("div#text2").html() ).insertAfter("div#popupText");
- } else if (popupName == "showPopup3") {
- $( $("div#text3").html() ).insertAfter("div#popupText");
- } else if (popupName == "showPopup4") {
- $( $("div#text4").html() ).insertAfter("div#popupText");
- }
-
- $("#middleLayer").toggle();
- $("#popup").toggle();
- });