how JQuery datepicker set the data inside the input text field

how JQuery datepicker set the data inside the input text field

As what i can see, the datepicker identify the ID of the text field and populate information.
Example:

$(#date).datepicker();

<input type = "text" id = "date"/>

But instead of identify by ID, i wanted to identify by name.
Example my scenario:

<logic:iterate....>






        <c:set var="arrayName" value="itemWrappers[${poItem_rowNum-1}]"/>


        <input type="text" id="ordDate" size="10" name="${arrayName}" value=""/>
   

        <script type="text/javascript">
   
      
            var dateId = '#' + ${arrayName};
   
            $(dateId).datepicker();
    </script>

</logic:iterate>          



i iterate a list of date field, everyone have the same ID which it will be populated into an array of ordDate, but every text field name is unique. example first records is itemWrappers[0], 2nd record is itemWrappers[1] and so on.
i want to populate the date based on the naming of the "name" attribute instead of ID.