Newbie to jquery
Newbie to jquery
Hi all
I am facing problem in the below mentioned code .It is not showing me the alertbox saying "hello". Please suggest the improvement.
<html>
<head>
<script src="jquery-1.11.0.min.js"></script>
</head>
<body>
<div class = "xx1"> John Mragegert </div>
<div class = "xx2"> THOMSON </div>
<div class = "xx3"> goosi John harvard</div>
</body>
<script>
$(document).ready(function() {
if($.contains(this,document.getElementsByClassName("xx1"))){
alert("hello");
}
});
</script>
</html>