Skip to content

Since v2.2.0: Cannot read property 'opener' of null when $.parseHTML and then get css style #2866

@todorpr

Description

@todorpr

I just upgraded to jQuery v2.2.0 and this problem appeared.

I could reproduce it in the following case:

  • parse some html using $.parseHTML
var el = $.parseHTML('<span style="font-family: Cuprum,sans-serif; font-size: 14px; color: #999999;">some text</span>');
  • on the already parsed html wrap it in jQuery container:
var span = $(el[0]);
  • now try to get css style on the jQuery element:
var style = span.css("font-size");
console.log(style);

Which results in:

Uncaught TypeError: Cannot read property 'opener' of null

jsBin: http://jsbin.com/ruyecuxogu/edit?html,js,console,output

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions