javascript - Jquery datepicker doesnt work on appended element -


i can't seem datepicker work on this.

my javascript:

$(function () {     $('.date-picker1').datepicker({ dateformat: 'yy-mm-dd' }).val();   } ); 

and function button call once clicked.

    var count2 = "1"; function addrow2(in_tbl_name) {     var tbody = document.getelementbyid(in_tbl_name).getelementsbytagname("tbody")[0];     // create row     var row = document.createelement("tr");       // create table cell 2     var td2 = document.createelement("td")     var strhtml2 = "<input class='date-picker1' name='date"+count2+"' id='date"+count2+"'     />";     td2.innerhtml = strhtml2.replace(/!count2!/g,count2);      row.appendchild(td2);      count2 = parseint(count2) + 1;     // append row table     tbody.appendchild(row); }  

like @adeneo said:
put:

$('.date-picker1').datepicker({ dateformat: 'yy-mm-dd' }).val(); 

after

tbody.appendchild(row); 

Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -