$('.page').on('click',function(){
$(this).next('.content').css('display','block');
$('body').empty('');
var post = $(this).next('.content').css('display','block');
post.appendTo('body');
});
How to clear all other thing except the .content so it's like u nagivated to a new page? I tried above code but my logic flawed. I'm new to jquery.
$('.page').html('');instead of$('body').html('');.empty('');should be.empty();Also note than once you.empty()the body element, there's nothing more to retrieve, so yoru lattervar post =will not get any desired element.