jqueryt选择器

Original 2019-05-16 10:56:04 266
abstract:<!DOCTYPE html> <html>             <head>             <

<!DOCTYPE html>

<html>

             <head>

             <title>jquery</title>

             <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>

             </head>

             <body>

                         <div id="timeId"></div>

                        <form>

                         <label>输入1</label><input type="text" name=""><br>

                         <label>输入1</label><input type="text" name=""><br>

                         <label>输入1</label><input type="text" name="" disabled><br>

                         <label>输入1</label><input type="text" name=""><br>

                        <select>

                         <option>qq</option>

                         <option selected>ww</option>

                         <option>ee</option>

                         </select>

                        

                         <label><input class="ch" type="checkbox" name="" value="vv">vv</label>

                         <label><input class="ch" type="checkbox" name=""v value="vv">bb</label>

                         <label><input class="ch" type="checkbox" name="" checked value="vv">cc</label>

                        </form>

            <script type="text/javascript">

                             $(function(){

                            //$('input[type]').css('background','pink');

                             //$(':enabled').css('background','red');

                             $(':selected').parent().css('background','blue');

                             $(':checked').css('background','pink');

                            // console.log($('.ch0').val());

                             // console.log($('.ch0').is(":checked"));

                             $cc=document.getElementsByClassName('ch');

                             console.log($cc.length);

                             console.log($($cc[2]).is(':checked'));

                            })

                        </script>

             </body>

</html>


Correcting teacher:查无此人Correction time:2019-05-17 09:20:44
Teacher's summary:完成的不错。jq比js简单很多,练好jq,可以减少很多工作量。继续加油

Release Notes

Popular Entries