开发者

.show() not working on document ready

I'm triggering a onchange event that i have on a textbox when the page loads

$(document).ready(function () {
   $("input[id$=dpDeliveryDate]").each(function () {
       $(this).get(0).onchange();
   });
});

This gets fired correctly and is calling a function I have created.

I开发者_开发百科f I put in alerts into this function it will alert on the page loading correctly. So I know its calling the function just fine! but does not do the rest of the commands in the function

Also if after the page loads I change the textbox value it also fires correctly this time doing all the commands correctly in the function..

THe function basically needs to do

 $(this).parent().next().next().show();

So I cannot work out why it works onchange but not when onchange is triggered from the document.load?


Change

$(this).get(0).onchange();

to

$(this).change();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜