0
'Add project'必須激發Bootstrap 3模式。怎麼做?如何在Bootstrap 3的選擇框中激活Modal
<option>Project A</option>
<option>Project B</option>
<option>Project C</option>
<option>Add Project </option>
</select>
'Add project'必須激發Bootstrap 3模式。怎麼做?如何在Bootstrap 3的選擇框中激活Modal
<option>Project A</option>
<option>Project B</option>
<option>Project C</option>
<option>Add Project </option>
</select>
您需要在select的change事件中調用bootstrap的模式。
$('select').change(function() {
var addProj = $('select option:selected').val();
if(addProj === 'Add Project'){
$('#example').modal();
}
});