0% found this document useful (0 votes)
102 views26 pages

Java Script Program With Solutions

Javascript program

Uploaded by

patilmohit0710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
102 views26 pages

Java Script Program With Solutions

Javascript program

Uploaded by

patilmohit0710
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
ee — pisiisoived Programs. at « . davaScript code, when a user ci write user clicked 0 ; Winners between 1 £0 10 ntimbers, on button, it will display sum of even Migoctspe html cehtml> chead> ‘cecript type= “text/javaseript”> function sevenO f yar i.s=0, i”+s) } chi align=center>Sum of even numbers between 1 to 10 numbers
0) Write JavaScript code, numbers between 1 to 10 numbers ns, :

All even numbers between 10 to 50 numbers

ae - , hi Ee a Pa Driven program in JavaScript to display the series as 1,8,5...11.

Display Series from 1 to 11
Write a event driven program in JavaSeri three Accepted numb Shead> ‘form name=p1> Greatest number between any three accepted value

‘submit onclick="sr()"> pt to find & display greater number between
Enter First Number :
oxt name as. input type=te: typo=text nam bit onclick="grthQ">
Enter Second Number * Enter Third Number : Write a event driven JavaScript code on the button.
=t3>
to count a length of accepted string afte T el

Co i alien vunt a length of accepted string

eat Sting ies type=text name=t1>
nut type=button value=submit onclick="clen()” Se area mit onclick="clen)”>
Write a Event driv en i seon Program in JavaScript to display Subtraction of two accep! - function stwo() [Link]=c: ‘ q g>
TE® Ans. % Ans “chi align=center>Subtraction of Two accepted Number
Pen. Enter First Number :
Enter Second Number :
Result:
Write Event driven program in JavaScript to display Factorial of a Accepted Number.
ts), } sum of 50 natural numbers mutton value=submit onclick="sf()"> 3) Write a Event Driven program i qy Writea en program in JavaS (es. avaScript to display length of the inputed string. function len { vara; a=[Link]; Iralength document. write(“The length of Entire string is="#); 5
Display length of Entire string input type=text name=tl>
mit onclick="lenQ”">
Javascript to calculate & display Square ofan Accepted Write Event Driven program Number, * ‘shead> “Script type= “textjavascript"> function edsqr( var ab; *parselnt([Link]);100 . beata; [Link](Square of accet } Calculate and Display square o
Enter any Number :
(14) Write a Event Driven program in JavaScript to display Area of ellipse (Hint Area = 3.14*r1*r2 accept required value from user). Ans.

Area of Ellipse

ypted Number is ="+b); f accepted Number | | 1 | Enter value of R1:
| Enter value of R2:
wi givisible™
(15) Write javascript code to accept any number and check the number i 7. After mouse button is clicked. Ans. script type= “text/javascript”> function divfos) { document. write(“Number is’+" ”+a+”  "+" divisible by 5 & 7): } else { [Link](‘Number is } }
Number is divisible by 5 & 7 > &enbsp;"+a+”&nnbsp;"+ "not divisible by 5 & 77; =t1>
e=text name® sgivfos0">
Enter any Number: Write a Event driven program im saver numbers. ‘shtml> shoad> ‘
Write a Event Driven program in JavaScript to display perimeter of a Trapeziun, (Hint : Perimeter=atbtetd ,accept required value from user)

Display perimeter of a Trapezium

Enter First perimeter :
Enter Second perimeter :
Enter Third perimeter :
. Enter Fourth perimeter :
Result;
: pauletoe Write a Event Driven program in JavaScript to display Area of P™ (Hint Area = base * height, accept required value from user) input type=text name=t1>
Jag) (29) Ans, sig

Sum of 100 Even Number

”); J I

Display Multiplication Table to: Enter Number :
function sfQ) { var s=0,5 for(a=1; a

a on button, it will display sum of even Sum of even numbers between 1 to 10 numbers
Write a program in java script to prim! shead>

MULTIPLICATION TABLE }; p=ptl) (82) Write a program in java seript to print the multiplication table of 5. Ans. i (33) Ans. (34) Ans, “ 7 chi>MULTIPLICATION TABLE OF 5. Snput type=button value"RESULT’ non onelick="mtn"> Write a program in java seri i og. (1128581821...) ‘ipt to display the fabonacei series

FABONACCI SERIES: ESULT" onelick="fb0"> npoxt/javascript’>Seti document. write¢hn mn Ineo 0) jocume! 1

Sinput type=button value="ARRAY LENGTH” onclick="arlen()”> (36) Write a event program in Ans.

REVERSE PRINTING ARRAY

on" onclick="eonstr0"> java script to print array in reverse order. ‘parg’ 7) rite a event program in j. a Write a event program in java seri : (es. CriDE Lo sorting of array,

(38) Write a event program in java script to add element in array. Ans. FIND WORKING DAY OR HOLIDAY

116 : alert(“Holiday Write a event program in j i Java script to find out ri: Hi i temperature using switch case statement. aac

on ="CORONA TESTING?” onclick="rep)”> value’116 ~ (a2) Ans. (43) Ans. Reliable Se, pt to find out square root and cube rage Write a event program in java sei e ye(pe wo) ns (3) U E rite aa event program in java seri wantspe tml> in java seript to display the message on wind ‘indow status bar. chead> cecript type=text/javascript”> fun ction wins() { [Link]="WELCOME TO JAVA SCRIPT PROGRAM” DISPLAY WINDOW STATUS BAR MESSAGE

"DISPLAY WINDOW STATUS BAR MESSAGE” onelick="wins("> function £10 { [Link]="req” ‘rindows sotTimeout(120°71200) } function £20 { document bgColor="eree”” viindow set Timeout('130"> 1200) 3 funetion £30 { document, bgColor="Pl window. setTimeout( function £40 { ue” 0”,1200) document. pgcolor="or0nee” 50”,1200) Window ee Timeout(48) Ans. Write a event program in java seript to p Natural Numbers Series

You might also like