Problem/Motivation

Use HTML5 data-* attributes instead of #ID selectors in Drupal.settings
Check [meta] Use HTML5 data-* attributes instead of #ID selectors in Drupal.settings

Proposed resolution

  • Take out JS references to $("#id") / $(".classname") and replace them with $("[data-drupal-element]")
  • Modify template/form so we add the data-drupal-* as said

Remaining tasks

We can divide this issue for each core module and one for the core:

  • action
  • aggregator
  • ban
  • basic_auth
  • block
  • block_content
  • book
  • breakpoint
  • ckeditor
  • color
  • comment
  • config
  • config_translation
  • contact
  • content_translation
  • contextual
  • datetime
  • dblog
  • editor
  • entity_reference
  • field
  • field_ui
  • file
  • filter
  • forum
  • hal
  • help
  • history
  • image
  • language
  • link
  • locale
  • menu_link_content
  • menu_ui
  • migrate
  • migrate_drupal
  • node
  • options
  • path
  • quickedit
  • rdf
  • responsive_image
  • rest
  • search
  • serialization
  • shortcut
  • simpletest
  • statistics
  • syslog
  • system
  • taxonomy
  • telephone
  • text
  • toolbar
  • tour
  • tracker
  • update
  • user
  • views
  • views_ui

And one for core.

User interface changes

NONE

API changes

NONE

Comments

nicobot’s picture

Status: Active » Closed (duplicate)

By mistake this issue was created twice: https://www.drupal.org/node/2346799

nicobot’s picture

Title: Replace #ID and .classname selectors for data-drupal-* attributes » Replace #ID and .class selectors for data-drupal-* attributes