Why doesn't this jquery selector with a period work

后端 未结 9 2023
长发绾君心
长发绾君心 2020-12-06 04:56

I have a div with an ID

this jquery selector works

$(\"[id^=\'updates-pane         


        
9条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-06 05:35

    Use this to escape your dot:

    $("#updates-pane-user\\.followed_on")
    

    Reference: http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_by_an_ID_that_has_characters_used_in_CSS_notation.3F

提交回复
热议问题