JavaScript samples for HTML5 - Internet Developer

Note that some of these are versions where I have made the code a little more professional with semi-colons etc. Some of the less professional (my original learning curve) versions will show up in the PowerPoint so I am referring to them here as well. Remember it is important to see a wide variety of styles in JavaScript because that is what you will encounter in the samples on the Web. Most code is not professionally done and you need to be able to work with it!
Sample JavaScript code Link to retrieve
Beginning JavaScript embedded in HTML5 helloWorld.html (not HTML5)
helloWorld5.html
multiply5.html
addnum5.html
addnumcont5.html
adddivide.html
mathdecision5.html
mathdecisionbetter5.html
paychkfirst5.html
paychksecond5.html
usingAND5.html
usingOR5.html
andeither5.html
andeithercom5.html
whileloop5.html
doloop5.html
forloop5.html
Loop examples from CIS120 Loop comparison: The first 6 use alert and also document.write to show everything at the end in rendor mode. The next 6 are done with just document.write which does not show data as it is being created.
Note that with the document.write, many browser versions hold the result in memory and write at the end. This is happening here. I put in the alert so you could see the processing as it went through the loop.
Math facts while loop (alert)
Math facts nested while loop (alert)
Math facts do...while loop (alert)
Math facts nested do...while loop (alert)
Math facts for loop (alert)
Math facts nested for loop (alert)
Math facts while loop
Math facts nested while loop
Math facts do...while loop
Math facts nested do...while loop
Math facts for loop
Math facts nested for loop
Continuing beginning JavaScript focus on loops and decisions ifwithloop5.html
finaltotals5.html
mathfactswhile5.html
mathfactswhilenested5.html
mathfactsdo5.html
mathfactsdonested5.html
mathfactsfor5.html
mathfactsfornested5.html
guessgameone5.html
guessgameonegame5.html
guessgamemulti5.html
Looking at basic DOM substitution for document.write Domwrite1.html
helloworldS19.html
multordivS19.html
adddivideS19.html
mathDecisionDOM.html
finaltotalsS19.html
finaltotalswinS19.html
ifwithloopDOM.html
More DOM from previous JavaScript whilelistS19.html
whilelistalertS19.html
whilelistaltS19.html
guessgamemultS19.html
mathfactswhileDOM.html
mathfactswhileDOMalt.html
JavaScript Events onmouse5.html
mousealert5.html
anothermouse5.html
altmouse5.html
altclickbutton5.html
clickbutton5.html
changebackground5.html
backgroundmouseF13.html
otherevents5.html
somemoreclick5.html
somemoreclick5rev.html
focusetc5.html
eventwithfunction5.html
functionbgfg.html
Some examples I tried using HTML5 and JavaScript Functions:
introfunc5.html
passfunc15.html
passfunc25.html
passfunc2a5.html
passfunc35.html
passfunc3a5.html
passfunc3b5.html
passfunc3c5.html
passfunc3d5.html
passfunc45.html
passfunc4a5.html
passfunc4b5.html
passfunc55.html
passfunc5a5.html
passfunc65.html
passfunc75.html
passfunc85.html
passfuncF11.html
passfuncF11by.html
passfuncF11bx.html
passfuncF13return.html (uses name)
passfuncF13return2.html (uses id)
testbkcolorF11.html
testbkcoloroldF11.html
Additional examples (similar to ones above):
    funcA.html
    funcB.html
    funcBa.html
    funcBb.html
    funcC.html
    funcD.html
calcfunction.html
calcfunctionprompt.html
calcfunctionprompt1.html
calcfunctionform.html
Loops (Mathfacts):
mathbasic.html
mathfor25.html
mathfor2a5.html
Arrays:
deptIIIarray.html
deptIIIarrayfunc.html
deptIIIarrayfunc2.html
Extra array information beyond scope of this course:
js2dim.html
assocarraycrs.html Associative array
assocarraycrsDOM.html Associative array using DOM
Arrays with DOM - extras
DOMwrite2.html
assocarraycrsDOM.html
Check boxes and radio buttons:
checkboxCrs.html
checkbox1.html
checkbox2.html
radiopay1.html
radiopay1id.html
radiopay1idtest.html
radiopay2.html
DOM examples passfuncDOM.html
passfuncnameDOM.html
multinamesDOM.html
multinamesDOMid.html
getbyID.html
test1.html
test1DOM.html
DOMeventsbasic.html
DOMeventsbasicalt.html
DOMevents.html
DOMBasics0.html
DOMBasics1a.html
DOMBasics2.html
DOMBasics3.html
DOMBasics4.html
DOMBasics4a.html
DOMBasics5.html
DOMBasics6.html
getelementbyid1.html
DOMinsertagain.html
DOMinsertagainmore.html
DOMinsertagainmore2.html
externaljs.js
externaljs2.js
More DOM examples calculatetotalpassreturnDOM.html
DOMgetinfo.html
Above and beyond...
    getimg.html
    DOMBasics1.html
    DOMgetinfo1.html
    DOMgetinfo2.html
    DOMgetinfo3.html
    DOMgetinfo4.html
    DOMgetinfoset.pdg (explanation)
    mathfacts5DOM.html
    addrow.html
    addrow2.html
    addrow4.html
JQuery Mobile Some of the examples in later zips, link to code in the beginning zips so I suggest one directory.
Basic examples to get started
Second group of basic examples
Bar and navigation examples

Send e-mail to Mrs. Grocer: pgrocer@bristol.mass.edu

Back to the Top
Return to home page
Return to previous page