Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • beat.web beat.web
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 54
    • Issues 54
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • beatbeat
  • beat.webbeat.web
  • Issues
  • #478
Closed
Open
Issue created Sep 28, 2017 by Jaden DIEFENBAUGH@jdiefenbaughContributor

Bad handling of complex DOM ids using querySelector

Using the statement:

document.querySelector(`#${ id }`)

where id is a string representing a DOM id can only handle a certain subset of allowable id strings. For example, whitespace will break this, because querySelector parses the given query string as a CSS query selector.

To fix, use document.getElementById for queries against element ids:

document.getElementById(`${ id }`)
Assignee
Assign to
Time tracking