Returning a Value from Function



Write a javascript code to return a value from functions.

<html>
  <head>
    <title>Function Demo</title>
      <script>

          function accept()
          {
              var s=prompt('Enter your city');
              return(s);
          }

          var r=accept();
          document.write(r);

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

Output: