Consider following code snippet:

    <style> .red { color: red; } </style>
    <script>
         // SCRIPT
    </script>    

    <ul>
        <li>list 1</li>
        <li>list 2</li>
        <li>list 3</li>
    </ul>
What do you need to insert instead of "// SCRIPT", that only element "list 1" was a red (select all correct options)?
Explanation
To select only the first li element you need to use :first-child selector. $('li:first-child').addClass('red'); - this option is wrong, because at the moment of execution the script no li elements will be loaded on the page.
  $ (document) .ready (function () {...});
$ (function () {...});  
Entries are identical and will execute the script after page fully loaded.
                    

Мобільний додаток Beta

Get it on Google Play
або Підпишись на майбутні тести