$('#select').on('change', function() {
name = $('#select :selected').val();
//some code here
});

. bdr-txtline {
border-bottom: 1px solid black;
}

<div class="container">
<div class="row">
<div class="col-xs-4">
<div id="Name" class="bdr-txtline">
</div>
</div>
</div>
</div>
&#13;
答案 0 :(得分:0)
在display:inline-block
中使用bdr-txtline
。
.bdr-txtline {
border-bottom: 1px solid black;
display:inline-block
}
<div class="container">
<div class="row">
<div class="col-xs-4">
<div id="Name" class="bdr-txtline">
two words
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-xs-4">
<div id="Name" class="bdr-txtline">
more than two words
</div>
</div>
</div>
</div>