Posts

Showing posts from January, 2020

Std XI I.T || Skill Set 3 – JavaScript || SOP4

Image
SOP4: Create event driven JavaScript programs for the following using appropriate variables, JavaScript inbuilt string functions and control structures. To accept number and validate if the given value is a number or not by clicking on the button. <!DOCTYPE html> <html> <head> <title>sop4</title> <script language=javascript> function val() { n=f1.v.value if(!isNaN(n)) document.write(n+" is a number") else document.write(n+" is a not number") } </script> </head> <body> <form name=f1> Enter Value:- <input type=text name=v> <br><br> <input type=Submit value=Submit onClick=val()> </form> </body> </html> To calculate addition and division of two numbers. <!DOCTYPE html> <html> <head> <title>sop4</title> <script language=javascript> function add() {...

Std XI I.T || Skill Set 3 – JavaScript || SOP3

SOP3: Create JavaScript program for the following using appropriate variables, JavaScript inbuilt string functions and control structures.        To accept string and calculate its length.          <!DOCTYPE html>          <html>          <head>          <title>sop3</title>          </head>          <body>          <h1> To accept string and calculate its length </h1>          <script language=javascript>           var n           n=prompt("Enter any text")           s=n.length           document.write("Length of the string is "+s)          </script...

Std XI I.T || Skill Set 3 – JavaScript || SOP2

SOP2: Create JavaScript program for the following using appropriate variables, JavaScript inbuilt functions and control structures          To accept two positive or negative numbers and check whether they are equal or not.                                 <!DOCTYPE html>              <html>              <head> <title>sop2</title> </head> <body> <h1> To accept two positive or negative numbers and check whether they are equal or not </h1> <script language=javascript> var n1,n2 n1= prompt("Enter first number positive or negative","type here") n2= prompt("Enter second number positive or negative ","type here") if(n1==n2) document.write(n1+ " and " + n2+" are equal" ) else document.write(n1+ " and " + n2+" are not eq...

Std XI I.T || Skill Set 3 – JavaScript || SOP1

Image
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...