The line of code below works, but I want to use a variable name for the name="1" part


I currently have an id (string data type) stored in a variable:

currentarowID = tbl2.rows[i].id;

but I can't work out how to put currentarowID inside the document.querySelector part - so something like:


Any help much appreciated.

I used the below in the end:


which worked

commented: Be sure to mark as solved. +15