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>




Picture showing the DOM on the web browser







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


Picture showing calling the DOM element using JavaScript



Posted By  -  Karan Gupta
 
Posted On  -  Thursday, July 1, 2010

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250