jq sku实现
2024-09-04 02:46:51
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
input{
width: 50px;
height: 35px;
background: orange;
}
</style>
</head>
<body>
<div class="container">
<div class="row row1">
<input type="button" value="红" />
<input type="button" value="黄" />
<input type="button" value="蓝"/>
<input type="button" value="白"/>
<input type="button" value="军绿"/>
</div>
<div class="row row2">
<input type="button" value="xl"/>
<input type="button" value="xxl"/>
<input type="button" value="xxxl"/>
</div>
<div class="row row3">
<input type="button" value="纯棉"/>
<input type="button" value="牛仔"/>
<input type="button" value="针织"/>
</div>
</div>
<!-- <script src="jquery-3.2.1.min.js"></script> -->
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
<script type="text/javascript">
$(".container .row input").on("click",function(){
var _this = $(this);
_this.attr("st",1)
const arr = [];
$.each($(".container .row1 input[st=1]"),function(index,val){
const key1 = val.value;
$.each($(".container .row2 input[st=1]"),function(index,val){
const key2 = val.value;
$.each($(".container .row3 input[st=1]"),function(index,val){
const key3 = val.value;
if(val){
arr.push([key1,key2,key3])
}
})
})
})
console.log(arr,"arr")
})
</script>
</body>
</html>
最新文章
- 响应者链条,如何获取最佳的点击view 以及内部实现
- Oracle中用随机数更新字段----将一张表的数据插入另一张表----环境设置
- 无线安全专题01--kali破解WPA
- [JS5] 利用onload执行脚本
- Java环境解析apk文件信息
- [开发笔记]-Visual Studio 2012中为创建的类添加注释的模板
- iOS 2D绘图详解(Quartz 2D)之Bitmap
- HTML5 中的块级链接
- 为 Date 对象添加 ago 属性
- 【转】NP-Hard和NP-Complete的区别
- 基础:获得servletAPI
- input输入框校验,字母,汉字,数字等
- CF959F
- 在IDEA中以TDD的方式对String类和Arrays类进行学习
- MongoDB4.0 WINDOWS环境下 副本集、分片部署
- Struts2国际化学习笔记
- Group By Grouping Sets
- C++中set的用法
- Booting dircetly into Redlink FW from flash
- seajs 笔记
热门文章
- 小程序API:wx.showActionSheet 将 itemList动态赋值
- vue中html、js、vue文件之间的简单引用与关系
- Python——作业12(选做)选中矩阵的每行或每列画出对应的折线图(python programming)
- idea Ctrl+Alt+T 快捷键失效
- 记一次flannel调试
- HNU_团队项目_Android和数据库对接出现问题总结
- 【ABAP系列】SAP 使用事务码DBCO实现SAP链接外部数据库以及读取例程
- 【AMAD】django-silk -- 为Django提供如丝般顺滑的性能测量
- 【JulyEdu-Python基础】第 4 课:面向对象基础
- 来吧,认识一下Bugcrowd社区的开源课程