Created by: chrisyeh96
Fixes #34381 (closed) by using document.getElementById() instead of document.querySelector() when testing the validity of an element ID.
Whereas document.querySelector() only allows valid CSS selectors and requires ID-based selectors to start with a letter, document.getElementById() handles all valid HTML5 element IDs.