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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.