1
// jQuery操作select下拉框的text值和value值的方法
https://www.cnblogs.com/swjian/p/6856706.html
2
https://www.cnblogs.com/hgmyz/p/6210976.html
3
<div>
First name:
<input type="text" id="text1" />
<br> Password:
<input type="password" id="password1" />
<br>
<select id="selectSM">
<br>
<option value="choosea" selected=true>选择A</option>
<option value="chooseb">选择B</option>
<option value="choosec">选择C</option>
</select>
<input type="radio" name="sex" value="male" />Male
<br>
<input type="radio" name="sex" value="female" />Female
<br>
<input type="checkbox" name="vehicle" value="Bike" checked=true />I have a bike
<input type="checkbox" name="vehicle" value="Car" />I have a car
<input type="checkbox" name="vehicle" value="TuiTui" />I have a tuitui
<br>
<button type="button" id="setBtn">set</button>
<button type="button" id="getBtn">get</button>
</div>
4
function setValue() {
$('#text1').val('set text 1');
$('#password1').val('set password 1');
$("#selectSM").val('chooseb');
$("#selectSM option[value='choosec']").attr("selected",true);
$("input[name='sex'][value='female']").attr('checked',true)
$("input[name='vehicle'][value='TuiTui']").attr('checked',true)
}
function getValue() {
console.log($('#text1').val());
console.log($('#password1').val());
console.log($("#selectSM").val());
console.log($('input[name="sex"]:checked').val());
console.log($('input[name="vehicle"]:checked').val());
}
$('#setBtn').click(function () {
setValue();
});
$('#getBtn').click(function () {
getValue();
});
====
https://getbootstrap.com/docs/4.0/components/modal/
$('#myModal').modal('show')
$('#myModal').modal('hide')
====
https://bootstrap-table.com/docs/getting-started/introduction/
<table id="table1222" class="table table-striped table-bordered"></table>
$('#table1222').bootstrapTable({
search: true,
// pagination:true,
// pageNumber: 1,
// pageList: [10, 25, 50, 100],
detailView: true,
detailFormatter: function (index, row, element) {
return 'ccc'
},
columns: [
{
checkbox: true,
field: 'id',
title: 'Item ID'
}, {
field: 'name',
title: 'Item Name'
}, {
field: 'price',
title: 'Item Price',
sortable: true,
},
],
data: [
{
id: 'id1',
name: 'name1',
price: 'price1'
},
{
id: 'id1',
name: 'name1',
price: 'price2'
},
],
});
$('#table1222').bootstrapTable('getSelections')
网友评论