.has()
.has()
I am also trying to use the .has() filter to add a class to the text inside the Div tag "Test". It doesn't work. I don't seem to figure out what I am doing wrong here....
- <script type="text/javascript">
- $(function() {
- $("div:has([id=first])").addClass("a");
-
- });
- </script>
- <style type="text/css">
- .a { color: Navy; }
- .b { color: Maroon; }
- </style>
- <div id="first">Test </div>