We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Some html ids not registering

Home Forums General Questions Some html ids not registering

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #71119
    johngrigni
    Customer

    I’m making a simple app:
    https://v3d.net/teh

    some of the buttons on the left work, some don’t. In the puzzles, I’ve made a on click using the target.id to get the id, and among other things, print it to console. Some of the buttons registers a click and moves the ‘info’ window over (a back button appears to move it back), but the id doesn’t print and it doesn’t change the text in the info window – it’s a blank line in the console. Several of the other buttons do work, include changing the text in the info window.

    Why won’t some of the ids register on the console?

    Editing to add: which button works and which doesn’t seems to change every time I open the app.

    • This topic was modified 2 months, 1 week ago by johngrigni.
    • This topic was modified 2 months, 1 week ago by johngrigni.
    • This topic was modified 2 months, 1 week ago by johngrigni.
    #71122
    kdv
    Participant

    Here is a link to the folder:

    You are the smartest questioner here :good:

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #71123
    johngrigni
    Customer

    If I was smart I’d know why the ids don’t all work.

    #71125
    kdv
    Participant

    Everything is registered correctly. But you have other HTML elements inside (and over) the blue buttons. If you click on texts it writes an empty string to the console log (your texts have no IDs). But if you click on the button itself (some where on the corner) you will see that it works.

    The trick is that when you click on the text element you also click on any other element under this text (the blue button, canvas, v3d-container, document and window). But the target ID is the uppest element under the pointer. Sometimes it’s good, sometimes it’s annoying but that’s how it works in browsers :unsure:

    Attachments:
    You must be logged in to view attached files.

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #71127
    johngrigni
    Customer

    If I remove the <p> tags will that fix it?

    #71130
    kdv
    Participant

    Nope, it won’t.

    That’s what you have (<div> inside <li>)

    That’s how it should be to work as you need.

    https://v3d.net/tel

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

    #71142
    johngrigni
    Customer

    I actually got it to work by using “pointer-event: none” in the css.

    Thank you for your help!

    #71147
    kdv
    Participant

    Yeap, that’s a good variant :good:

    Puzzles and JS. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of meaning at all.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.