Can you select an element with two classes in jQuery

Posted by Petras on Stack Overflow See other posts from Stack Overflow or by Petras
Published on 2010-05-23T02:15:51Z Indexed on 2010/05/23 2:20 UTC
Read the original article Hit count: 320

Filed under:
|
|
|

I have an element that has two classes but can't seem to select it with jQuery. Is it possible. Here's the code:

<html>
<head runat="server">
    <script type="text/javascript" src="abc/scripts/jquery-1.4.2.min.js"></script>

    <script type="text/javascript">

      $(document).ready(function() {
        alert($(".x.y").html()); //shows null, I want it to show "456"
      });

    </script>

</head>

<body>

<div class="x" class"y">456</div>

</body>
</html>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about classes