Jquery :contains showing alert for all span

前端 未结 4 1242
旧时难觅i
旧时难觅i 2021-01-14 16:10

I have a span Text goes her like this

$(\'#contentarea\').bind(\'click\',function(e){
             


        
4条回答
  •  执念已碎
    2021-01-14 16:15

    you can use the attribute selector...(if you just need to select the span containing the style attribute as font..)

    try this

    $('span[style^="font-"]')
    

    this should select the span with style starting with font-

    or

    $('span[style="font-weight: bold;"]')
    

    fiddle

提交回复
热议问题