2

This is such a basic thing, I could not figure out. Consider the following:

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>

    <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.js" />
    <script language="JavaScript" type="text/javascript">

        function Show(msg){
            alert(msg);
        }

    </script>
</head>
<body>
<input type="button" onClick="Show('hello');" value="Show 1" />
</body>
</html>

The above sample works fine if I exclude "jquery" include. What am I missing here?

user203687
  • 6,875
  • 12
  • 53
  • 85

1 Answers1

5

that is because self closing script tags do not work. use:

<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.js"></script>

Link to reference

Community
  • 1
  • 1
Milind Anantwar
  • 81,290
  • 25
  • 94
  • 125