Skip to content

Sizzle.attr TypeError #2055

@rafaelchavesfreitas

Description

@rafaelchavesfreitas

The code below throws an Uncaught TypeError Exception because Sizzle.attr tries to call getAttribute of a comment element but comments does not have this function.

$(function(){
    $('body').on('DOMNodeInserted', '*[data-test]', function () { 
        console.log(this); 
    }).append('<!-- new comment -->');
});

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions