2019-04-28属性选择器

2019-04-28  本文已影响0人  果冻_4c9b
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript">
            $(function(){
               // $('input[type = "text"]').css('color','aqua')
               $('input[value^= 1]').css('color','aqua')
               $('input[value$= 1]').css('color','green')
               $('input[value*= 9]').css('color','blue')
            })
        </script>
        <style type="text/css">
            /* input[type = 'text']{
                color:aqua;
            } */
        </style>
    </head>
    <body>
        <input type="text" name="" id="" value="1223" />
        <input type="text" name="" id="" value="321" />
        <input type="text" name="" id="" value="92123" />
        <div type="text">
            jkj 
        </div>
    </body>
</html>
上一篇 下一篇

猜你喜欢

热点阅读