Javascript change variable to targeted id

I have a dot navigation system with a slider I created. All the dots have the id of a number (1, 2, 3, 4) and when you click a dot I want the variable count to change to the ID of the dot, but I have no idea how I can get the ID.

    let tgt = event.target;
    let cur = tgt.querySelectorAll('.CDot')

This code shows me the right element of the dot that I need the ID of.

    console.log(cur.id)
    control.count = cur.id;

I tried doing something like this, but it’s undefined. I tried alot, but I can’t seem to get the id of the element. Does anybody know the right way?