web实验5

<style type="text/css">
					body{margin: 0;}
					.div{
						display: flex;
						flex-direction: column;
						align-items: center;
						width: 600px;
						top: 20px;
						position: absolute;
						left: calc(50% - 300px);
					}
						table{
							margin-top: 30px;
							background-color: black;
					
					}
					tr{
						text-align: center;
					}
		            thead th{
		                background: white;
		            }
					th, tr{
						height: 30px;
						border-radius: 1px;
						width: 80px;
					}
					table  th:nth-child(3){
						width: 200px;
					}
		            .scan{
		                display: flex;
		                flex-direction: column;
		                align-items: center;
		            }
				</style>

<body>
			<div class="div" >
	            <div class="scan">
	                <label>
	                    查询:
	                    <input class="f_text">
	                </label>
	            </div>
	            <table class="table">
	                <thead>
	                <tr>
	                    <th>姓名</th>
	                    <th>性别</th>
	                    <th>暂住地</th>
	                </tr>
	                </thead>
	                <tbody>
	                <tr>
	                    <th>张山</th>
	                    <th>男</th>
	                    <th>浙江宁波</th>
	                </tr>
	                <tr>
	                    <th>李四</th>
	                    <th>女</th>
	                    <th>浙江杭州</th>
	                </tr>
	                <tr>
	                    <th>王五</th>
	                    <th>男</th>
	                    <th>湖南长沙</th>
	                </tr>
	                <tr>
	                    <th>找六</th>
	                    <th>男</th>
	                    <th>浙江温州</th>
	                </tr>
	                <tr>
	                    <th>Rain</th>
	                    <th>男</th>
	                    <th>浙江杭州</th>
	                </tr>
	                <tr>
	                    <th>MAXMAN</th>
	                    <th>女</th>
	                    <th>浙江杭州</th>
	                </tr>
	                <tr>
	                    <th>王六</th>
	                    <th>男</th>
	                    <th>浙江杭州</th>
	                </tr>
	                <tr>
	                    <th>李字</th>
	                    <th>女</th>
	                    <th>浙江杭州</th>
	                </tr>
	                <tr>
	                    <th>李四</th>
	                    <th>男</th>
	                    <th>湖南长沙</th>
	                </tr>
	                </tbody>
	
	            </table>
	
	        </div>
			<script type="text/javascript">
	            $("table tr:odd").css('background-color','#FFF38F');
	            $("table tr:even").css('background-color','#FFFFEE');
	            $('input').keyup(function(){
	                $('table tbody tr').hide().filter(":contains("+$(this).val()+")").show();
	            });
			</script>
		</body>
```3333333

```css

	<body>
		<div class="div" >
            <form action="">
                <select name="province" class="province">
                    <option>
                        请选择省份
                    </option>
                </select>
                <select name="city" class="city">
                    <option >
                        请选择城市
                    </option>
                </select>
            </form>
		</div>
		<script type="text/javascript">
            var province = ["河北省","山西省","辽宁省"];
            var city = [
                ["石家庄市","唐山市","秦皇岛市","邯郸市","张家口市","保定市"],
                ['太原市','大同市','阳泉市', '长治市','运城市','临汾市'],
                ['沈阳市', '大连市', '鞍山市', '盘锦市', '朝阳市']
            ];
            var prov_select = $(".province");
            $.each(province,
                function (i,n){
                prov_select.append("<option  selected>"+n+"</option>");
                }
            )
            prov_select.get(0).selectedIndex = 0;
            prov_select.change(function (){
                    var id = $(".province").get(0).selectedIndex;
                    $(".city option[value='1']").remove();
                    $.each(city[id-1],
                        function (i,n){
                            $(".city").append("<option value='1'  selecte
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值