attributes not found by jquery attribute selector

后端 未结 2 1381
眼角桃花
眼角桃花 2021-01-12 19:00

I need to reask my old question, I probably shouldnt have asked it at 1am :P

It seems that some attributes are not being found using jquery\'s attribute selector:

2条回答
  •  时光取名叫无心
    2021-01-12 19:18

    There is no "list" of unsupported attributes because there shouldn't be; this is a bug in jQuery.

    Here are the open tickets on this:

    • Can not select a form using the action attribute
    • attr "action" of form and Selectors' attribute filter
    • selector by attribute "src" not working the same way as in 1.2.6

    Apparently the common denominator between the bugs is that jQuery is comparing the selector string you specify against the full URL as opposed to the actual action/src attribute as it is defined in the HTML. This explains why the attributeEndsWith or the attributeContains selectors do work in this case.

    I would recommend just giving the form/image a class/ID and getting it over with.

提交回复
热议问题