Select every element with an id attribute: ($(“[id]”))


<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript" src="lib/jquery/jquery-1.3.2.js">
        </script>
        <script type="text/javascript">
            $(document).ready(function(){
                $("[id]").css("background-color", "red");
            });
        </script>
    </head>
    <body>
        <h1>This is header</h1>
        <p class="intro">There is some text for paragraph</p>
        Who is your favourite:
        <ul id="choose">
            <li>aaa</li>
            <li>bbb</li>
            <li>ccc</li>
        </ul>
    </body>
</html>

Comments

Popular posts from this blog

371 - Ackermann Functions

Create many folder with one click