JS Assignment 1
JS Assignment 1
DATE:
ASSTGNMENT- 1
Q'List the keu ditexence betwcenTava and
Tavascript
Java
Tavascript
DCbject Onthtd Ppqramaoin Chent -stde ceripting
q created by ame lanquage by Neteape
Suh micro originally krouun
systtom ater accupled liyescript
by oracle.
s) Event Handling'
="elcome"
let tuo= to slmpli learO
Declaring
Tavascript atepond to Vaio
eventIike dick iapute and &Croll, cnhancing ConAolelog (one) WAcecaing vazlable ane
Wer cxpertehce. console.loq(tesl: lAcceuinq yaxtable two
conacle. log Cthrce)ilAceataing wariablethee
4 DoM Manlpulation
Tt inttract stth the Docwnent object Model Scope af vanable elere to the accetsibllity
(DOM) to modity and updat oeh page ofa partcudarvaiableoltbin the prgram.
conteotand structue
s) Cross platformi const meuraqe ="HII"; ZDeAining a vanable
aorki pérating ytena and h
&upported by all madern eh booDLCrs Aunction hoof
canuclelog meacage): MAcceaging
4)pen 8Ource Commuslty another Aunctibn
A large deueloper cammunity conbibute huo i Calingfunchon tuo
ibrdnie frameusotke and tool4 to enbance
Tavascript capabilihes Tavascoipt Vartable haediterent ariahle
scopei they
Galobal cope
DATE
Locadeope Prtoitlve
)ndeAned?
Repraed undaftned value
Block ope
avatep had only
had osly twokypaocope
gloeope
The block
andoead cope. Repxucnl hullvalut
qnynull
kayoovd A that ABocltan valueohlchcan be
Repitnt alboolean.
Functen cops!
Whh he. creien ecach Dafupdon )
Creater sOp h avarlpt.
DATE DATE
<scipt> Chody
Cbuttn
<Ihtol onclickachaeameesage O
click Me <buton
AR Dercribe the to indude Tavasuript
in HTML <lbody
(3) Extcnal Tavaccript
be Can include Tavasript directly ithin You c¡n place yeur Tovaccript code in a
HTML I to yourHIML
and ather
the
ondick, onchange.
event attibutc
ceperat file and
atrthut
ile uinq <snipt > tag
reatrallythir methad Ia uued when we
have t a Auncinn in the HTMI evert (4) Exent Handler Albibute i
atbibute The an cases or event) sn code alo be ncludedl
Tavacccipt Can
ohich oe haxe to adod Taxarcript cade drectty within the HTML cleomcntalng
evtot handler atbibute ke onclick
diredly
eq onmoYr event.ondick etc Lanloadetc
<body>
Ka haef = "#°anclick = alest ('Hi).> Qrg Compasion aptrator n Tavasccipt
olick Me <la> Compaiton aperat
value and retura
<lhody med
Roollan
to
cault
cormpare
tnu of falae) based
Ce) Tnternal Tavacripti the compankon
You pclude Joxageript code dir edly
oithin an HTML Ale a <script> tban
y<Aas than
2)= tater than equal to
<teript A<=ear than equal to
Auncton
alert choon
(Hellaearage
to
K Perfom hype conveTaion meaninq t
COnvere the value to a type
Lbefore
aaking the Campaaison
PAGE NO.
DATE:
aperatons
<html>
<head
<itle Javasript-compa riton optratu
<hite>
Shead
<body >
<ecript lanquage :Tavaseipt" tupe
text Iavascript ">
Var hum1E lo:
Var hum2 = 5
document.write ("numt' num
documnt.coite num2iDurp)
document write "Eahalto l==):"
num 1== num 2)/Aalse