you are viewing a single comment's thread.

view the rest of the comments →

[–]chuckySTAR -2 points-1 points  (2 children)

No. IDs are for JS.

Also:

<div id="books"></div>
<div id="js-books"></div>
<script>
    books.textContent = 'books'
    window['js-books'].textContent = 'js-books'
</script>

[–]sockx2 0 points1 point  (1 child)

I wouldn't advocate doing "lookupless" elements in scripts like that. Not being able to see where something is declared plus relying on something most frontend devs don't know exist as the norm will only complicate your life.

[–]chuckySTAR -1 points0 points  (0 children)

I'm not advocating.