zoukankan      html  css  js  c++  java
  • jq sku实现

    
    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="UTF-8">
            <title></title>
            <style>
                input{
                     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>
    
    
  • 相关阅读:
    2017北京网络赛 J Pangu and Stones 区间DP(石子归并)
    2017北京网络赛 F Secret Poems 蛇形回路输出
    2017 北京网络赛 E Cats and Fish
    CF 1198 A. MP3 模拟+滑动窗口
    博弈论
    gym 101911
    容器STL
    POJ 3281 Dining 最大流+拆点
    hdu 1533 Going Home 最小费用最大流 (模板题)
    C#博文搜集
  • 原文地址:https://www.cnblogs.com/chengyunshen/p/11138045.html
Copyright © 2011-2022 走看看