testLou.html 1.86 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover">
    <meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
    <title>Title</title>
</head>
<body>
<style>
    .aaa {
        color: red;
    }
</style>
<div class="p">
    <div class="aaa" id="a" data-url="111">aaaa</div>
    <div class="bbb" data-url="111">abbbb</div>
    <div class="bbb" data-url="111">abbbb</div>
    <div class="bbb" data-url="111">abbbb</div>
    <div>a2111</div>
</div>
<div class="p">
    <div class="asd" data-url="112">2222</div>
    <div class="asd aaa" data-url="113">333333</div>
    <div class="asd aaa" id='b' data-url="114">bbbb</div>
</div>
<button onclick="fun()">button</button>
<!--<script src="./jq.js"></script>-->
<script src="../build/sdk.js"></script>
<script>
     var $ = window.yo_sdk.$;
    function fun() {
        console.log(arguments[1])
        var obj = $('.p').find('.aaa')
        console.log(obj)
        // $('#a').click(function(){
        //     console.log(111);
        //     console.log(this);
        // })
        //var arr = $('body').find('.asd').attr('data-url','aaaa');
        // $('body').find('.aaa').each(function(index,el){
        //     $(el).html('<p>asdasdsa</p>')
        //});
        //var b = $('.aaa');
        // console.log(b.last());
        // b.appendTo('.bbb');
        // var b = document.getElementsByClassName('aaa');
        // var len = b.length
        // for (var i = 0; i < len; i++) {
        //     console.log();
        //     if(b[i] !== document.getElementById('a')){
        //         debugger;
        //         var el = b[i].cloneNode(true);
        //     document.getElementById('a').appendChild(el)}
        // }
        // console.log(document.querySelectorAll('#a'))
    }
</script>
</body>
</html>