i need some help with this, i'm trying to generate some html with javascript, but always get the same, this is my javascript code
var datePickerHTML = function(id){
var html = "<div id='"+id+"' class='ui-datepicker'>";
html += "Hello World, my ID is "+id;
html += "</div>";
return html;
}
var UhmaCalendar = function(config){
var dpID = 'dp'+config.inputField;
this.dpID = dpID;
jQuery('#'+config.inputField).after(function(){
return datePickerHTML(dpID);
});
jQuery('#'+config.btn).click(function(){
jQuery('#'+dpID).toggle('slow');
}
}
now, in my html i write
UhmaCalendar({
btn : 'countday_pick',
inputField : 'countday'
});
UhmaCalendar({
btn : 'sartday_pick',
inputField : 'startday'
});
this is for 2 diferent input and buttons, but they always show the same div with the same text, and id i check the html withthe firebug, only one div is created, ad i want 2 div with diferent ids i also try with
new UhmaCalendar({
btn : 'sartday_pick',
inputField : 'startday'
});
but is the same, what am i doing wrong here thanks