Sunday, 2024-04-28, 3:47 AM
Welcome Guest | RSS
Site menu
Tag Board
500
Our poll
Which .Net class is more interset for you ?
Total of answers: 225
Statistics

Total online: 1
Guests: 1
Users: 0
20-12-2010

Eg: for alert pop up box:
    <html>
       <head>
        <script type = "text/javascript">
              function myfun()
            {
             alert("virtual memory is low")
            }
        </script>
       </head>
       <body>
            <input type = "button" value = "Display" onclick = myfun()>
       </body>
    </html>
  Output: Virtual Memory is Low

Eg: for Confirm Box
    <html>
       <head>
        <script type = "text/javascript">
              function myfun()
            {
             confirm("Do you want to restart your computer")
            }
        </script>
       </head>
       <body>
            <input type = "button" value = "Display" onclick = myfun()>
       </body>
    </html>
Output:    Do you want to restart your computer

Eg: To pass a value to java script function:
    <html>
        <head>
        <script type = "text/javascript">
        function display(txt)
        {
          alert(txt)
        }
        </script>
      </head>
      <body>
        <input type = "button" value = "Morning" onclick = "display(Good Morning)">
        <input type = "button" value = "Evening" onclick = "display(Good Evening)">
      </body>
      </head>
    </html>

document.write():    It is a java script command, it will display the given value on web page.

Here, document is a pre-defined object & write is a pre-defined method.
Write method will print the given value on web page.

Eg: for returning a value from Java script function
    <html>
      <head>
        <script type = "text/javascript">
        function add(a,b)
        {
         return a+b
        }
        </script>
      </head>
      <body>
        <script type = "text/javascript">
        document.write(add(10,5))
        </script>
      </body>
    </html>
Output: 15
Search

Time
 

 

Calendar
 
«  April 2024  »
SuMoTuWeThFrSa
 123456
78910111213
14151617181920
21222324252627
282930

Twitter
 

Entries archive

Copyright R N Reddy © 2024Developed by Nagendra, Venkat, Vijaya and Yaswanth
Get free updates as SMS to your mobile. Just register by clicking here