直接复制粘贴即可修改使用:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js">
</script>
<style>
div{
width: 80%;
height: 200px;
margin: 20px;
border: 1px solid;
}
select{
width: 100px;
margin: 10px;
}
</style>
<body>
<select name="sel" id="sel">
<option></option>
<option value="0">女士风格</option>
<option value="1">男生风格</option>
</select>
<div id="t1">1</div>
<div id="t2">2</div>
<div id="t3">3</div>
</body>
<script>
$(document).ready(function(){
$('#sel').change(function(){
var id = $(this).children('option:selected').val();
if (id == 0){
$('#t1').css("background-color","#FF0000");
$('#t2').css("background-color","#00FF00");
$('#t3').css("background-color","#9F5F9F");
$("#t1").html('化妆品');
$("#t2").html('包包');
$("#t3").html('首饰');
} else if (id ==1){
$('#t1').css("background-color","#7093DB");
$('#t2').css("background-color","#8E236B");
$('#t3').css("background-color","#2F4F6F");
$("#t1").html('吃鸡');
$("#t2").html('王者');
$("#t3").html('联盟');
}
})
})
</script>
</html>