Jquery :contains showing alert for all span

前端 未结 4 1243
旧时难觅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:12

    Try:

    var isBold =$(e.target).css('font-weight');
    if($(isBold === ("bold")|| isBold === 700){
                             alert('bold');
                        }
    

    This way you check for existence of CSS properties.

提交回复
热议问题