Html
    Css
    Js

    
                        
input {
	text-align:center;
}
.goodsAdd {
	width:100%;
}
.goodsAdd .goodsType {
	width:100%;
}
.goodsAdd .goodsType .goodsTypeItem {
	width:100%;
	height:35px;
	padding-top:5px;
	padding-bottom:5px;
}
.goodsAdd .goodsType .goodsTypeItem button {
	margin-left:10px;
	background-color:#DDDDDD;
	height:32px;
	line-height:16px;
	border:none;
	border-radius:2px;
	padding:10px;
}
.goodsAdd .goodsType .goodsTypeItem .active {
	background-color:#449D44;
	color:#fff;
}
.goodsAdd .goodsLists {
	border-collapse:collapse;
}
.goodsAdd .goodsLists td,.goodsAdd .goodsLists th {
	border:1px solid #f4f4f4;
}
.goodsAdd .submit {
	position:fixed;
	right:10%;
	top:50%;
}

                        
↑上面代码改变,会自动显示代码结果 jQuery调用版本:1.11.1
 立即下载

自动批量生成商品属性及价格原生js

1. 将可选的商品类型以json对象形式传入, 即: goodsTypeData

var goodsTypeData = {
    "颜色":["红色","绿色","黄色","蓝色"],
    "尺码":["S","M","L"],
    "布料":["蚕丝","纯棉","羽绒"],
    "产地":["广州","浙江","绵阳"]
};

2. 输入相关信息后, 点击提交即可在submit()函数内获得最终结果: result

3. 通过post请求提交 result 即可

4. 后续会增加商品属性外的可选项目, 目前只支持   价格 | 数量 | SKU

0