jquery / jquery/api.jquery.com

jQuery.fn.data() and data-* attribute name restrictions

Open
#383 6 comments 0 reactions 1 assignee View on GitHub

@AurelioDeRosa is already working on this.

Since Oct 6, 2015.

help wanted
Dominant language
HTML
Stars
325
Forks
260
PR merge metrics
No merged PRs in 30d

Description

http://bugs.jquery.com/ticket/14376

jQuery.fn.data() will not work data-* attributes in the very specific case where an attribute has been named with multiple words and any of the words after the first word (not including data-) begin with a digit.

Example:

<div data-foo-42></div>

However, these work just fine:

<div data-42></div>
<div data-foo42></div>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.