In Association with Amazon.in   Flipkart

Tuesday, September 10, 2013

JavaScript Arrays And Its Types

Array: In JavaScript an Array is a collection of Heterogeneous Elements. So all type of values can be store in one array.

There are 3 types of Arrays in Javascript:

1. Numeric Array

2. Associative Array

3. Multi-Dimensional Array



Tuesday, September 3, 2013

JavaScript Alert Function With Example

Alert() :- To display alert message in the dialogue.



Example for alert

<html>
<head>
       
</head>
<body>
   <script>

           a = 10;        
           alert('Value of a is ' + a); 

    </script>


</body>
</html>

 

Thursday, August 22, 2013

HTML Fieldset And Legend Tags Example

Example:

<fieldset style=" width:350px; background-color:#CCF">

  <legend style="padding:4px 12px; border:double; background-color:#CC9">Login</legend>
    <table width="350" height="138" border="0" cellpadding="12" cellspacing="6" >
        <tr>
                <td>Username:</td>
            <td><input type="text" name="unm" placeholder="User Name" /></td>
        </tr>
        <tr>
                <td>Password:</td>
            <td><input type="password" name="pwd" placeholder="Password" /></td>
        </tr>
        <tr>
          <td colspan="2" align="center" valign="middle">
          <input type="submit" value="Login" />
          </td>
        </tr>
    </table>

</fieldset>


Output:


Login
Username:
Password:

Saturday, August 10, 2013

Javascript Do While Loop Example

Do While:  If the given condition is true/false Do Wile Executes at least once.

 

Example:

<body>
    <script>


    t=9;
    i=10;
    do
    {
        document.write("<br/>" + t+ " X " + i + " = " + i*t);   
        i++;
    }while(i>12);
   
    </script>
</body>



OutPut:

9 X 10 = 90




Related Posts Plugin for WordPress, Blogger...