php_guest Posted June 21, 2009 Share Posted June 21, 2009 I have one simple question. How to delete everything inside div? I know how to delete it together with div $("#test").remove(); but I don't looking for that because I want that <div id="test"></div> stay there. Thank you Link to comment https://forums.phpfreaks.com/topic/163078-jquery-delete-everything-inside-div-but-not-the-div/ Share on other sites More sharing options...
trq Posted June 21, 2009 Share Posted June 21, 2009 $("#test >*").remove(); Link to comment https://forums.phpfreaks.com/topic/163078-jquery-delete-everything-inside-div-but-not-the-div/#findComment-860456 Share on other sites More sharing options...
Ken2k7 Posted June 21, 2009 Share Posted June 21, 2009 $("#test").text(''); Link to comment https://forums.phpfreaks.com/topic/163078-jquery-delete-everything-inside-div-but-not-the-div/#findComment-860483 Share on other sites More sharing options...
php_guest Posted June 21, 2009 Author Share Posted June 21, 2009 $("#test >*").remove(); tnx, works perfectly! Link to comment https://forums.phpfreaks.com/topic/163078-jquery-delete-everything-inside-div-but-not-the-div/#findComment-860591 Share on other sites More sharing options...
vbnullchar Posted June 23, 2009 Share Posted June 23, 2009 $("#test").empty(); Link to comment https://forums.phpfreaks.com/topic/163078-jquery-delete-everything-inside-div-but-not-the-div/#findComment-861955 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.