Std XI I.T || Skill Set 3 – JavaScript || SOP1
SOP1: Create JavaScript program for the following using appropriate variables, JavaScript inbuilt functions and control structures. · To accept integer and display the result by multiplying it with 3. <!DOCTYPE html> <html> <head> <title>sop1</title> </head> <body> <h1>To accept integer and display the result by multiplying it with 3</h1> <script language=javascript> var num,ans num=prompt("Enter a number") ans=num*3 document.write("Answer = "+ans) </script> </body> </html> Type the code in notepad application and save the code as usual in a folder. Provide suitable filename for example sopjs1a.html. In these examples we are embedding JavaScript codes in HTML hence we provide .html extensions to the filenames. To see the output as per academic specifications use Internet Explo...
Comments
Post a Comment