hello. I have this javascript
<script type="text/javascript">
function buildMonthlyEntries() {
var startDate = new Date(document.getElementById('datastart').value);
var endDate = new Date(document.getElementById('dataend').value);
if(startDate == "Invalid Date" || endDate == "Invalid Date") { return null; }
var entryCount = (endDate.getMonth() - startDate.getMonth())+(endDate.getFullYear() - startDate.getFullYear())*12;
var monthlyEntries = document.getElementById('monthlyEntries');
monthlyEntries.innerHTML = "";
for(var i = 0; i < entryCount; i++) {
var textElement = document.createElement('input');
textElement.setAttribute('type', 'text');
textElement.setAttribute('name', 'entry[]');
monthlyEntries.appendChild(textElement);
}
return null;
}
</script>
It dynamically ads a number of input fields depending on the number of months between start date and end date. I was wondering how can i add in front of every generated input the month's name. Thanks!