Skip to main content
Stack Overflow
  1. About
  2. For Teams

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

function is not invoking in javascript

Can anyone tell what is problem in the following code... when i run the program in browser a blank white screen appears... I don't know why its not working... I am not very sure with the syntax...
I don't want to invoke the function by any events.. i just want to write a function and invoke it by a manual call...

 <html>
 <head>
 <script language="javascript" type="text/javascript">
 function salin()
 {
 var sal = prompt("Enter your current salary - ","");
 var in = prompt("Enter the increment % - ","");
 sal = parseInt(sal);
 in = parseInt(in);
 var nsal = sal +( sal*(in /100));
 alert("Your new salary is - " + nsal);
 }
 salin();
 </script>
 </head>
 <body>
 </body>
 </html>

Answer*

Draft saved
Draft discarded
Cancel
1
  • 1
    Good answers don’t just dump "working" code. Good answers explain the OP’s mistake or how to approach the problem. Commented Jul 12, 2017 at 5:12

default

AltStyle によって変換されたページ (->オリジナル) /