How to handle getElementById return Null

后端 未结 4 1296
感动是毒
感动是毒 2021-01-27 13:22

On our web application there are many pages. Some of them contain element \"Ribbon.ListForm.Display.Manage.Workflows-Medium\" while some pages not.

I would like to use s

4条回答
  •  囚心锁ツ
    2021-01-27 14:08

    Since the question is tagged with jQuery:

    $('#Ribbon\.ListForm\.Display\.Manage,#Ribbon\.ListForm\.Display\.Manage\.Workflows-Medium,#Ribbon\.ListForm\.Display\.Manage\.CheckOut-Large')
        .filter(function() {
            return this.value == '';
        })
        .hide();
    

    First, it will select the elements you're interested in; then, it will hide those that match a simple filter based on value.

提交回复
热议问题