<Script src = "Jquery1.7.js" type = "text/javascript"> </script>
<Script type = "text/javascript">
$ (Function (){
$ ('# Btn'). click (function (){
// Add A style for all the text in the div element including the element, including the nested Element
// $ ('Div: contains (A) '). addClass ('classadd ');
// Add a style for all elements in the div element that do not contain child elements or text
// $ ('Div: empty'). addClass ('classadd ');
// Set the style for all elements in the div element that contain the span element, excluding the span Element
// $ ('Div: has (span) '). addClass ('classadd ');
// Set a style for all elements that contain child elements or text
$ ('Div: parent'). addClass ('classadd ');
})
})
</Script>
</Head>
<Body>
<Form id = "form1">
<Div> ABCD </div>
<Div> <span> </div>
<Div> EACH </div>
<Div> </div>
<Div> CAD </div>
<Div> <span> </div>
<Input type = "button" id = "btn" value = "Click me"/>
</Form>
</Body>