Articles → JavaScript → Introduction To Javascript
Introduction To Javascript
What Is JavaScript?
What Does The Word Dynamic Mean?
Is JavaScript A Compiled Or A Interpreted Language?
Document Object Model
<html>
<head>
<title>DOM example</title>
</head>
<body>
<form>Enter Name <input type="text" name="txtName" /></form>
</body>
</html>
Calling Document Object Model Using JavaScript
<script language = "JavaScript">
</script>
function ClickMe() {
alert(document.forms[0].txtName.value);
}
<input
type="button"
name="btnDOM"
value="Click Me"
onclick="javascript:ClickMe();"
/>
<html>
<head>
<title>DOM example</title>
<script language="JavaScript">
function ClickMe()
{
alert(document.forms[0].txtName.value);
}
</script>
</head>
<body>
<form>
Enter Name
<input type="text" name="txtName" />
<input
type="button"
name="btnDOM"
value="Click Me"
onclick="javascript:ClickMe();"
/>
</form>
</body>
</html>
Try It
Output