Why the alert message is not being displayed ??
This is my code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery demo</title>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script>
$(document).ready(function(){
alert("Hi welcome to Jquery ");
}
);
</script>
</body>
</html>
In my browser it works. Try making the following improvements to make it more compliant:
1) Add the attribute
type="text/javascript"to yourscripttags.2) Move the scripts to the
headpart of the document.PS: You can use the following shorthand notation to have a function called when the document finishes loading: