AddEventListener for multiple elements doesn't work with “focus” event

前端 未结 3 1885
孤城傲影
孤城傲影 2021-01-25 19:17

I\'m guessing I have a basic error in thinking but I just can\'t get around it.

I have a couple of text fields which I want to add an EventListener to. I put them all i

3条回答
  •  孤独总比滥情好
    2021-01-25 19:47

    The click event bubbles up to ancestor elements.

    The focus event does not, and it is the that is being focussed, not the outer element.

提交回复
热议问题