JSFiddle - React, Tailwind, and code Playground

by nadeemmnn2007

HTML

<select id="categoryDelivery0"><option selected>1</option><option>2</option><option>3</option><option>4</option></select>
<select id="categoryDelivery1"><option >1</option><option selected>2</option><option>3</option><option>4</option></select>
<select id="categoryDelivery2"><option >1</option><option >2</option><option selected>3</option><option>4</option></select>
<select id="categoryDelivery3"><option >1</option><option >2</option><option >3</option><option selected>4</option></select> <br>

JavaScript

var deliveryRowsAdded = 2 // Could be 1, 2, 3 4, etc.
var currentElem = "categoryDelivery" + deliveryRowsAdded;
alert($("#" + currentElem ).val()); // This does not work