Can't select HTML5 element's children in IE8 with jQuery selector

前端 未结 2 863
青春惊慌失措
青春惊慌失措 2020-12-31 15:42

I found some posts with similar issues, but this is something different. I upgraded from jQuery 1.4 to 1.4.2 after I read another post, but the problem still presents itself

2条回答
  •  礼貌的吻别
    2020-12-31 15:47

    is an HTML5 element not supported in IE8, you'll have issues using it as an element, including finding children beneath it. It isn't a jQuery problem, it's a basic DOM problem, here's a demonstration:

    All I'm doing is giving the element an ID to simplify things:

    Then try and get it's children:

    document.getElementById('btn').children.length
    

    This gets you a 2 in HTML5 browsers, an 0 in IE.

提交回复
热议问题