Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 67441

Is there a way to increment custom HTML attributes?

$
0
0

I'm building something using dynamic fields and I want to be able to number each field so I can use POST requests.

Is there a way that I can increment custom attributes so I know which field is which?

var qID = 0;

<div class="questionContainer" data-question-id="qID"></div>

qID++;

I've tried this but it just converts the attribute into a string. Thanks!


Viewing all articles
Browse latest Browse all 67441

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>