Lab03 - Digital Logic ECE-1551 Lab 3: HTML: Basic...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Digital Logic ECE-1551 Lab 3: HTML: Basic Javascript Objectives: Intro to Javascript Javascript Adds scripting functions to a webpage <SCRIPT></SCRIPT> Denotes beginning and end of script Attributes: LANGUAGE=”JAVASCRIPT” FUNCTION Create a function Syntax: function functionname(inputvariables) { operations performed } VAR Creates a variable Syntax: var variablename=variablevalue; A variable value can take multiple forms, but in order to complete the assignments for today we’ll only look at a couple of examples. var example=new Array (0,1,2,3,4,5,6); creates a variable called example which is an array of numbers var formitem=myForm.drop.selectedIndex; creates a variable called formitem which takes the value of the index(1=1 st , 2=2 nd , 3=3 rd , etc) of the selected option from the selection named drop in the form named myForm. var sum=12+example[formitem]; creates the variable named sum which equals 12 + the element of the array example designated by the value of formitem. If formitem=4, example[4]=3,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Lab03 - Digital Logic ECE-1551 Lab 3: HTML: Basic...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online