开发者

Targeting elements in a jQuery Dialog, Why must use this as context

I find that when I am trying to target an element in a jQuery Dialog, I must do something like

$("#elemInDialog", this).val()
                   ^

I found that this only occurs in my simple code seen http://jiewmeng.kodingen.com/test/jquery-autocomplete.html or http://jsfiddle.net/28GMT/ (in jsFiddle or jsbin, the auto complete doesn't wor开发者_C百科k even, but it works in my hosted version) what did I do wrong?


You have at least one typo in there:

This line:

$("#txtArea").val( $("#txtArea").val() + "\n" + $("#txtUrl").val() );

should be:

$("#txtArea").val( $("#txtArea").val() + "\n" + $("#txtURL").val() );

With that fix, things seem to work okay for me, as far as I can tell?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜