How to get html() from element excluding another element?

后端 未结 2 1743
庸人自扰
庸人自扰 2021-01-13 06:21

Sorry for real stupid question. But it does not work either way.





        
2条回答
  •  滥情空心
    2021-01-13 06:50

    I think you are trying to do:

    var htmlcontent = $('.content').remove(".dontgrab").html();
    

    You could use .not() if the situation was like:

    var htmlcontent = $('div').not(".dontgrab").html();
    
    
    
    BEFORE AFTER
    DON'T GRAB

    I dont think you can use .not for selected elements children. I hope it helps

提交回复
热议问题