Skip to content
This repository was archived by the owner on Aug 14, 2021. It is now read-only.
This repository was archived by the owner on Aug 14, 2021. It is now read-only.

jquery-migrate-3.0.0.js warning #130

@wanderleihuttel

Description

@wanderleihuttel

In the line 478 is necessary to remove the method removeAttr() and change with attr() for jquery migrate no show warnings.

from:
$entryLi.removeAttr("title");

to:
$entryLi.attr("title", "");

https://github.com/jquery/jquery-migrate/blob/master/warnings.md

JQMIGRATE: jQuery.fn.removeAttr no longer sets boolean properties
Cause: Prior to jQuery 3.0, using .removeAttr() on a boolean attribute such as checked, selected, or readonly would also set the corresponding named property to false. This behavior was required for ancient versions of Internet Explorer but is not correct for modern browsers because the attribute represents the initial value and the property represents the current (dynamic) value.

Solution: It is almost always a mistake to use .removeAttr( "checked" ) on a DOM element. The only time it might be useful is if the DOM is later going to be serialized back to an HTML string. In all other cases, .prop( "checked", false ) should be used instead.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions