开发者

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

开发者 https://www.devze.com 2023-02-05 13:09 出处:网络
When I execute this code, my jquer开发者_JAVA技巧yui modal form closes.Why does it do this? $(document).ready(function() {

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

精彩评论

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

关注公众号