Skip to content
Advertisement

Jquery use value of for loop to append to id attribute

I am making quiz like app. For every question, it will have 4 answers. Then I will use radio buttons to indicate the right answer. How can I append the value of the loop to the id attribute?

Thank youuu

Here is my code snippet:

JavaScript

Advertisement

Answer

As per our discussion, this answer works out for your needs:

JavaScript

I just use template strings to place the value of j at the id attribute of the text input.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement