Categories JavaScript Answers How to use querySelector with IDs that are numbers with JavaScript? Post author By John Au-Yeung Post date September 5, 2022 No Comments on How to use querySelector with IDs that are numbers with JavaScript? Spread the love To use querySelector with IDs that are numbers with JavaScript, we add '#\\3' before the number. For instance, we write const el = document.querySelector("#\\31 "); to select the element with ID 1 with querySelector. Related Posts How to use querySelector with IDs that are numbers with JavaScript?Sometimes, we want to use querySelector with IDs that are numbers with JavaScript. In this… How to Use querySelector with IDs that are Numbers in JavaScript?To use querySelector with IDs that are numbers in JavaScript, we have to escape the… How to Use querySelector with IDs that are Numbers in JavaScript?Sometimes, we want to use querySelector with IDs that are numbers in JavaScript. In this… By John Au-Yeung Web developer specializing in React, Vue, and front end development. View Archive → ← How to fill the whole canvas with specific color with JavaScript? → How to load scripts asynchronously with JavaScript? Leave a Reply Cancel replyYour email address will not be published. Required fields are marked *Comment * Name * Email * Website Save my name, email, and website in this browser for the next time I comment. Current ye@r * Leave this field empty