开发者

Why does my jqueryui modal form close when I execute this code?

When I execute this code, my jquer开发者_JAVA技巧yui modal form closes. Why does it do this?

$(document).ready(function() { $('#mylink').click(function(){ $('#textfield').val = ''; }); });

mylink is defined like this:

<a href"" id="mylink">My Link</a>


Try $('#textfield).val('');

That's normally how you set the value.


you need to return false in the click function to prevent the page from posting back

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜