R N REDDY .Net Community - ASP
Sunday, 2016-12-04, 11:50 PM
Welcome Guest | RSS
Site menu
Tag Board
500
Our poll
How is .Net classes by R.N.Reddy sir ?
Total of answers: 230
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
 
«  December 2016  »
SuMoTuWeThFrSa
    123
45678910
11121314151617
18192021222324
25262728293031

Twitter
 

Entries archive

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