开发者

jQuery Tabs - Ajax version

I have my jquery ajax tabs running great. However I having problems getting/setting the content of an "input" on my selected Tab when the tab load.

This is what I have so far:

    $("#开发者_StackOverflow中文版tabs").tabs({
    load: function(event, ui) {
             //$("#myinput").text('test');
                 $("#myinput").val('test'); <-- works 
            }
    });


That's because an input's value is set with .val() not .text().

$("#tabs").tabs({
load: function(event, ui) {
         $("#myinput").val('test');
        }
});


An input doesn't have text(), it has, instead, val(), therefore try using:

$("#tabs").tabs({
    load: function(event, ui) {
             $("#myinput").val('test');
            }
    });

References:

  • text().
  • val().


If I understand well you have to set #myinput as .val('test') not as .text('')

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜