新手 求教下拉联动问题 数据库jsjava 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有些小bug将就着看吧<!DOCTYPE html ><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> new document </title> <meta charset="utf-8" /> <script src="jquery.js"></script> <script type="text/javascript"> function show(){ var dataSource = [{"name":"手机1","count":"5"},{"name":"手机2","count":"3"},{"name":"手机3","count":"8"}]; $("#sPhone").empty(); for(var i=0;i<dataSource.length;i++){ $("#sPhone").append("<option value='"+ dataSource[i].count +"'>"+ dataSource[i].name +"</option>"); } $('#sPhone').change(function(){ $("#kucun").text("库存:"+$("#sPhone").val()); }) ; } </script> </head> <body><select id="sPhone"></select><span id="kucun"></span><a href="#" onclick="show();">加载</a> </body></html> js中function()的返回值问题 火狐兼容问题! JS选项卡切换功能 问一个参数的问题 Date的setMonth求救 一个超级简单的问题,答出即给分! 为什么高度不能设置为0 一个很简单的问题,请教各位 有关日期检验的问题? <object> 加载的页面中 如何 父级页面的元素 js关闭窗口问题 后台返回list 怎样遍历在页面table
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta charset="utf-8" />
<script src="jquery.js"></script>
<script type="text/javascript">
function show(){
var dataSource = [{"name":"手机1","count":"5"},{"name":"手机2","count":"3"},{"name":"手机3","count":"8"}];
$("#sPhone").empty();
for(var i=0;i<dataSource.length;i++){
$("#sPhone").append("<option value='"+ dataSource[i].count +"'>"+ dataSource[i].name +"</option>");
} $('#sPhone').change(function(){
$("#kucun").text("库存:"+$("#sPhone").val());
}) ;
}
</script>
</head> <body>
<select id="sPhone">
</select>
<span id="kucun"></span><a href="#" onclick="show();">加载</a>
</body>
</html>