jQuery find exact HTML content

前端 未结 5 783
死守一世寂寞
死守一世寂寞 2021-01-28 13:06

I am using the following script to find all h1 elements, within a parent ID container that will fit a curtain criteria...

$(\'#cpcompheader h1\').html(\"&nbs         


        
5条回答
  •  失恋的感觉
    2021-01-28 13:43

    You could try finding all the h1 tags and then checking if they contain a certain value.

    $('#yourParent h1').each(function(){
        if($(this).html() == " "){
            // magic
        }
    });
    

提交回复
热议问题