I have an array of form fields that are dynamically created. I am trying to target the 16th div in that array and add a different class to it using JQuery. Here is the code I currently have:
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("div.form_row.clearfix:nth-child("+16+")").addClass("form_row_price");
});
</script>
But it doesn’t appear to be adding the class to the div. How can I make it so that the class “form_row_price” is added to the 16th div in my form?
Use eq() instead of nth-child().