输入框不能自动调整到文本引导程序3

时间:2014-05-25 21:48:05

标签: angularjs twitter-bootstrap pug inputbox

输入框宽度不适合我的占位符文字或其内容的大小:

form.form-inline(role='form')
    div.form-group
        div.dropdown
            button.btn.btn-info.dropdown-toggle(type='button', data-toggle='dropdown') {{loadButtonText}}
                span.caret
            ul.dropdown-menu(role='menu')
                li(ng-repeat='rss in RSSList')
                    a(href='#', ng-click="loadFeed(rss.url, $event);") {{rss.Title}}
        div.form-group
            input.form-control(type='text', autocomplete='off', placeholder="This is where your feed's url will appear" data-ng-model='url')

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

我无法粘贴示例链接,但我找到了这个。

<input placeholder="Please enter your name, address and shoe size">
<input placeholder="Please enter">

var input = document.querySelectorAll('input');
for(i=0; i<input.length; i++){
    input[i].setAttribute('size',input[i].getAttribute('placeholder').length);
}

因为填充,你可能想要添加长度为5-10px