Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

addClass() called with an array doesn't add all of the classes if one of them is an empty string #4998

Closed
@MatmaRex

Description

@MatmaRex

Description

WhenaddClass() is called with an array, and one of the classes in the array is an empty string, it doesn't add all of the classes (it stops processing them after the empty string).

Minimal test case:

$('<div>').addClass(['a','','b']).attr('class')

Expected output:a b
Actual output:a

Link to test case

https://jsbin.com/voxetucoho/edit?js,console

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp