开发者

Jquery Date Picker Event

开发者 https://www.devze.com 2023-03-18 16:53 出处:网络
I\'ve Javascript to create element input tex开发者_如何学编程t box to store jQuery date picker, but it doesn\'t work:

I've Javascript to create element input tex开发者_如何学编程t box to store jQuery date picker, but it doesn't work:

jQuery(document).ready(function($) {
        $( "#pohdddt" ).datepicker({showOtherMonths: true,selectOtherMonths: true,dateFormat: 'dd.mm.yy',showOn: 'button',buttonImage: "<?php echo base_url()?>icons/cal.gif", buttonImageOnly: true, showAnim: 'slideDown', duration: 'fast'});
});


var cell = document.createElement("td");
    var theInput = document.createElement('input');
    var img = document.createElement('img');
    img.setAttribute('alt', 'select date ');
            img.setAttribute('class', 'ui-datepicker-trigger');
            img.setAttribute('src',base_url_no_index+'icons/cal.gif');
            
            theInput.setAttribute('id', 'pohdddt'+i);
            theInput.setAttribute('name', 'pohdddt');
            theInput.setAttribute('value', '<?php echo date('d.m.Y'); ?>');
            theInput.setAttribute('size', '10');
            theInput.setAttribute('class','hasDatepicker');

            cell.appendChild(theInput);
            cell.appendChild(img);
            row.appendChild(cell);   

How to call jQuery event Onclick when this element is created? If so I'll create var Ahref = document.createElement('a');.

Any suggestion ?


$('#target').click(function() {
  alert('Handler for .click() called.');
});

html code

<div id="other">
  Trigger the handler
</div>

for complete info go through http://api.jquery.com/click/

0

精彩评论

暂无评论...
验证码 换一张
取 消