Web Programming CS333/CS614

Size: px
Start display at page:

Download "Web Programming CS333/CS614"

Transcription

1 Web Programming CS333/CS614 Lecture 7 & Java Script 1

2 The HTML Document Object Model : HTML is an abstract model that defines the interface betweenhtml documentsand application programs. It defines language-agnostic interfaces which abstract HTML documents as objects and mechanisms to manipulate this abstraction. HTML Level 2 was published in late It introduced the "getelementbyid" function,3(april 2004). HTML defines a standard way for accessing and manipulating HTML documents. A language that supports the must have a binding to the constructs 2 2

3 Nodes Every piece of an HTML document (element,attribute,text, ) is modeled in the web browser by a node The Node object represents a node in the HTML document. A node in an HTML document is: The Document An element An attribute Text 3

4 Nodes Nodes are related to each other through child parent relationships An html element inside another element is said to be its child, the containing element is known as parent A node can have multiple children but only one parent Nodes with the same parent are known as siblings 4

5 JavaScript and HTML In the JavaScript binding, HTML elements are represented as objects and element attributes arerepresented as properties e.g., <input type = "text" name = "address"> would be represented as an Input Text object with two properties, type and name, with the values "text" and "address" JavaScript document Object Each HTML document loaded into a browser window becomes a Document object. The JavaScript document object provides access to all HTML elements in a page, from within a script. The Document object is also part of the Window object, and can be accessed through the window.documentproperty. DHTMLDemo1.HTML 5

6 JavaScript Execution Environment The Window object provides the largest enclosing referencing environment for scripts Implicitly defined Window properties: document - a reference to the Document object that the window displays frames - an array of references to the frames of the document 6

7 HTML Objects Reference Document object Event object HTMLElement object Anchor object Area object Base object Body object Button object Form object Frame/IFrame object Textarea object Frameset object Image object Input Button object Input Checkbox object Input File object Input Hidden object Input Password object Input Radio object Input Reset object Input Submit object td object Input Text object Link object Meta object Object object Option object Select object Style object Table object th object tr object 7

8 HTML HTMLElement Object An HTML element is everything from the start tag to the end Tag <p> Hello World </p> <a href= cnn </a> <p><b>cloud Computing</b></p> The HTMLElement collections, properties, and methods can be used on all HTML elements. HTMLElement Properties innerhtml style Sets or returns the HTML contents (+text) of an element Sets or returns the style attribute of an element HTMLElement Methods focus () blur() select() Gives focus to an element Removes focus from an element select element 8

9 HTML Document Object Every Document object has: -forms - an array of references to the forms of the document Ø Each forms object has an HTML elements array, which has references to the form s elements - Property arrays for HTML elements like links, & images Property anchors[] forms[] images[] title Body links Method getelementbyid() Description Returns a collection of all <a> elements in the document that have a name attribute Returns an array of all the forms in the document Returns an array of all the images in the document The title of the document Returns the body element of the document Returns a collection of all <a> and <area> elements in the document that have a href attribute Description Accesses the first element with the specified id The Document object can also use the properties and methods of the Node object. DHTMLDemo1.HTML 9

10 HTML Form Object Collection elements[] Description Returns an array of all elements in a form Property action length method name Description Sets or returns the value of the action attribute in a form Returns the number of elements in a form Sets or returns the value of the method attribute in a form Sets or returns the value of the name attribute in a form Method Description reset() Resets a form submit() Submits a form Event The event occurs when... onreset The reset button is clicked onsubmit The submit button is clicked document.forms[0].submit() document.forms[0].reset() document.forms[0].action= the_other_script.pl ; 10

11 Element Access in JavaScript There are several ways to do it 1. address Use the implicit arrays, each form has an implicit array elements storing the elements in form Example (a document with just one form and one widget): <form action = ""> <input type = "button" name = "pushme"> </form> Var element=document.forms[0].elements[0] Problem: document changes 11

12 Element Access in JavaScript 2. Element names requires the element and all of its ancestors (except body) to have name attributes Example: <form name = "myform" action = ""> <input type = "button" name = "pushme"> </form> var element=document.myform.pushme Problem: name attribute is not valid starting from XHTML

13 Element Access in JavaScript 3. Access using I.D. i- using getelementbyid Method The method returns a reference to the object with the specified ID Example: <form action = ""> <input type = "button" id = "pushme"> </form> var element=document.getelementbyid("pushme") Form elements often have ids and names both set to the same value 13

14 3. Access using I.D ii-you can pass the id as string to a function, The function will receive it as a reference to the object with the specified ID Example: <form action = ""> <input type = "button" id = "pushme"> onclick=m(pushme); </form> function m(elm) { //elm here is a reference to the button } 14

15 HTML Document Object. Method createattribute() createelement() createtextnode() Description Creates an attribute node Creates an Element node Creates a Text node (inner html) appendchild() Adds a new child node, to the specified node, as the last child node 15

16 Example: Adding a paragraph element <!DOCTYPE html> <html> <body> <p>click the button to add a paragraph element.</p> <div id="div1"> <p>initial line </p> </div> <button onclick="myfunction()">try it</button> <script> function myfunction() { var para=document.createelement("p"); var node=document.createtextnode("this is new."); para.appendchild(node); div2=document.getelementbyid("div1"); div2.appendchild(para); } </script></body></html> addelementdemo.html 16

17 Example: Adding a list item element <!DOCTYPE html> <html> <body> <ul id="mylist"><li>coffee</li><li>tea</li></ul> <p id="demo">click the button to append an item to the list</p> <button onclick="myfunction()">try it</button> <script> function myfunction() { var node=document.createelement(li"); var textnode=document.createtextnode("water"); node.appendchild(textnode); document.getelementbyid("mylist").appendchild(node); } </script> </body> </html> addelementdemo2.html 17

18 HTML Text Object Ø The Text object represents a single-line text input field in an HTML form. Ø For each <input type="text"> tag in an HTML form, a Text object is created. The Text object can also use the properties/methods of: The Node object The Element object Text Object Properties value Sets or returns the value of the value attribute of the text field 18

19 Example: accessing a text field.. <head> <script type = "text/javascript" > function greeting() { name=document.form1.txt1.value; window.alert("hello " +name); } </script> <body> <form name="form1"> <input type="text" name="txt1"> <input type="button" value="click Me" onclick="greeting();" > </form>. Demo1.html SelectDemo.html 19

20 <form name="calc"> <input type="text" name="txt1" size="16"> Example: Calculator Calculater.html <input type="button" value=" 1 " OnClick="Calc.txt1.value += '1'"> <input type="button" value=" 2 " OnCLick="Calc.txt1.value += '2'"> <input type="button" value=" 3 " OnClick="Calc.txt1.value += '3'"> <input type="button" value=" + " OnClick="Calc.txt1.value += ' + '"> <input type="button" value=" 4 " OnClick="Calc.txt1.value += '4'"> < input type="button" value=" 5 " OnCLick="Calc.txt1.value += '5'"> <input type="button" value=" 6 " OnClick="Calc.txt1.value += '6'"> <input type="button" value=" - " OnClick="Calc.txt1.value += ' - '"> <input type="button" value=" 7 " OnClick="Calc.txt1.value += '7'"> <input type="button" value=" 8 " OnCLick="Calc.txt1.value += '8'"> <input type="button" value=" 9 " OnClick="Calc.txt1.value += '9'"> <input type="button" value=" x " OnClick="Calc.txt1.value += ' * '"> <input type="button" value=" c " OnClick="Calc.txt1.value = ''"> <input type="button" value=" 0 " OnClick="Calc.txt1.value += '0'"> <input type="button" value=" = " OnClick="Calc.txt1.value = eval(calc.txt1.value)"> <input type="button" name="div" value=" / " OnClick="Calc.txt1.value += ' / '"> 20

21 Example: Money Exchanger <script > function calculate() { var input1=window.document.form1.txt1.value; var output=(parsefloat(input1))/6; output=output.tofixed(2); window.document.form1.txt2.value=output+"$"; } </script> <body> <h3> Transfer from L.E. to $ </h3> <form name="form1"> Value in L.E.<input type="text" size="4" name="txt1"/> <input type="button" value="transfer " onclick="calculate()"/> Value in $ <input type="text" disabled="disabled" size="4" name="txt2" /> </form> moneyexchanger.html 21

22 Example :Log In demo function login(){ var username=document.myform.username.value; var password=document.myform.pass.value; if ((username.length==0) (password.length==0)) { window.alert("empty user name or password!");} else { switch(password) { case "12345" : window.location="page1.html"; break; case "1234" : window.location="page2.html"; break; case "123": window.location="page3.html"; break; default: window.alert("invalid Password"); document.myform.pass.select(); }// end switch case } Logindemo.html 22

23 Example: Dynamic Clock function clock() { date=new Date(); time=date.tolocaletimestring(); document.form1.txt1.value=time; today=date.todatestring() document.form1.txt2.value=today; window.settimeout("clock()",1000); } JavaScript Date Object tolocaletimestring() : Return the time portion of a Date object as a string, using locale conventions Convert the time portion of a Date object to a string: tolocaledatestring() : Return the Date object as a string, using locale conventions totimestring() Convert the time portion of a Date object to a string todatestring() Converts the date portion of a Date object into a readable string DynamicClock.html 23

24 Window setinterval() Method Syntax setinterval(function,milliseconds) Parameter function milliseconds Description Required. The function that will be executed (anonymous or name) Required. The intervals (in milliseconds) on how often to execute the code Return Value: A Number, representing the ID value of the timer that is set. Use this value with the clearinterval() method to cancel the timer The setinterval() method calls a function or evaluates an expression at specified intervals (in milliseconds). The setinterval() method will continue calling the function until clearinterval() is called, or the window is closed. The ID value returned by setinterval() is used as the parameter for the clearinterval() method. Example Alert "Hello" every 3 seconds (3000 milliseconds): setinterval(function(){ alert("hello"); }, 3000); 24

25 Window clearinterval() Method Definition and Usage The clearinterval() method clears a timer set with the setinterval() method. The ID value returned by setinterval() is used as the parameter for the clearinterval() method. Example Toggle between two background colors once every 300 milliseconds, until it is stopped by clearinterval(): var myvar = setinterval(function(){ setcolor() }, 300); function setcolor() { var x = document.body; x.style.backgroundcolor = x.style.backgroundcolor == "yellow"? "pink" : "yellow"; } function stopcolor() { clearinterval(myvar); } togglebackground.html 25

26 Example: Dynamic Clock2 <!DOCTYPE html> <html> <body> <p>a script on this page starts this clock:</p> <p id="demo"></p> <button onclick="mystopfunction()">stop time</button> <script> var myvar = setinterval( mytimer, 1000); //var myvar = setinterval( mytimer(), 1000); will not work //var myvar = setinterval( mytimer(), 1000); o.k. function mytimer() { var d = new Date(); var t = d.tolocaletimestring(); document.getelementbyid("demo").innerhtml = t; } function mystopfunction() { clearinterval(myvar); } </script> </body> </html> DynamicClock2.html 26

27 Example :Automatic Filling of text input <head> <script type = "text/javascript" > function getfullname() { firstname=document.form1.firstname.value; lastname=document.form1.lastname.value; name=firstname+" "+lastname; document.form1.fullname.value=name; } </script> <body onload="document.form1.firstname.focus()"> <form name="form1"> <table> <tr><td > First Name </td> <td> <input type="text" name="firstname" onchange="getfullname();" > </td> </tr> <tr><td> Last Name </td> <td> <input type="text" name="lastname" onchange="getfullname();"> </td> </tr> <tr><td> Full Name</td> <td> <input type="text" name="fullname"> </td> </tr> 27 </table></form> Dr Walid M. OnChangeDemo.html Aly

28 Accessing a check box/radio button For each instance of an <input type="checkbox"> tag in an HTML form, a Checkbox object is created. For each instance of an <input type="radio"> tag in an HTML form, a radio object is created. You can access a Checkbox / radio button object by searching through the elements[] array of a form, or by using document.getelementbyid(). Property checked value Description Sets or returns the checked state of a checkbox/radio button Sets or returns the value of the value attribute of a checkbox/radio button Reading the state of a checkbox if (document.form1.checkbox1.checked) { user_input = document.form1.checkbox1.value; } Setting the state of a checkbox document.form1.checkbox1.checked = true Checkboxes and radio button have an implicit array, which has their name checkbocdemo1.html checkbocdemo2.html radiodemo1.html 28

29 HTML Select Object Collection options Description Returns a collection of all the options in a drop-down list Property length selectedindex Description Returns the number of options in a dropdown list Sets or returns the index of the selected option in a dropdown list <select> <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="mercedes">mercedes</option> <option value="audi">audi</option> </select> 29

30 Example : Reading value from Select <script type="text/javascript"> function ShowCity(elm){ var val = elm.options[elm.selectedindex].value; window.alert("city Population : " +val);} </script> /////////////////////////////////////////////////// <title>millionaire Cities</title> </head> <body> <h3>millionaire Cities</h3> Select City <select name="query" id="query" style="width:273px;"> <option value="20,464,000">new York</option> <option value="5,232,000">milan</option> <option value="11,547,000">lagos</option> <option value="17,311,000">beijing</option> <option value="10,755,000">paris</option> <option selected="selected" value="37,126,000">tokyo</option> <option value="17,816,000">cairo</option> <option value="14,374,000">calcutta</option> <option value="20,186,000">sao Paulo</option> <option value="5,427,000">madrid</option> </select> <input type="submit" name="cmdshow" value="view Population onclick="showcity(query);" id="cmdshow" /> </body> SelectReadDemo.html 30

31 Validation Validation isa good use of JavaScript, because it finds errors in form input before it is sent to the server for processing Things that must be done: 1. Detectthe error and producean alert message 2. Put the element in focus (the focus function) - puts the cursor in the element 3. Select the element (the select function) - highlightsthe text in the element A Whole form can be checked before submitting using the onsubmit event To prevent the form submitting data, the event handler for onsubmitmust return false 31

32 Example Text Field Validation function check() { data=document.form1.txt1.value; if(isnan(data)) window.alert( " Please Enter a number"); else if(data.length==0) window.alert( " You did not eneter a Value "); else window.alert( " Data is correct, Thanks "); } </script> <form name="form1"> <input type="text" name="txt1"> <input type="button" value="send" onclick="check();" > </form> TextValidation.html 32

33 HTML Form Object Collection elements[] Description Returns an array of all elements in a form Property action length method name Description Sets or returns the value of the action attribute in a form Returns the number of elements in a form Sets or returns the value of the method attribute in a form Sets or returns the value of the name attribute in a form Method Description reset() Resets a form submit() Submits a form Event The event occurs when... onreset The reset button is clicked onsubmit The submit button is clicked document.forms[0].submit() document.forms[0].reset() document.forms[0].action= the_other_script.pl ; 33

34 Example : comparing passwords <form id = "myform" action = "" onsubmit="return chkpasswords();"> <p> Your password <input type = "password" id = "initial" size = "10" /> <br /><br /> Verify password <input type = "password" id = "second" size = "10" /> <br /><br /> <input type = "reset" name = "reset" /> <input type = "submit" name = "submit" /> </p> </form> pswd_chk.html 34

35 function chkpasswords () { var init = document.getelementbyid("initial"); var sec = document.getelementbyid("second"); if (init.value == "") { alert ("You did not enter a password \n" + "Please enter one now"); init.focus(); return false; } if (init.value!= sec.value) { alert("the two passwords are not the same \n" + "Please re-enter both now"); init.focus(); init.select(); return false; } else { window.alert("submitting Information"); return true; } } 35

36 Example: Validation <head> <script type = "text/javascript" > function check() { =document.form1.txt1.value; x= .indexof("@"); if(x==-1) window.alert( + : Invalid "); else window.alert( +" :valid "); } </script> <body> <form name="form1"> <input type="text" value=" " name="txt1"> <input type="button" value="check " onclick="check();" > </form> </body> </html> Validation.html 36

37 The JavaScript this keyword In JavaScript this always refers to the owner of the function we're executing, or rather, to the object that a function is a method of. <input type=button id= bt1 onclick= m(this) /> In previous example this refer to the button with id= bt1: <form action=" " name="demoform" onsubmit= "return valid(this.menu,this.choicetext)"> In previous example this refer to the form with name = demoform : 37

38 Example :Select Validation <form action="" onsubmit="return valid(this.menu,this.choicetext)"> <div> <select name="menu"> <option value="0" selected>(please select:)</option> <option value="1">one</option> <option value="2">two</option> <option value="3">three</option> <option value="other">other, please specify:</option> </select> <input type="text" name="choicetext"></div> <div><input type="submit" value="submit"></div> </form> ComboBoxValidation.html 38

39 <script > //check if user chose to enter a value function last_choice(selection) { return selection.selectedindex==selection.length - 1; } Function valid(menu,txt) { //check if user did not make a selection if(menu.selectedindex == 0) { alert('you must make a selection from the menu'); return false;} //check if user did not write a value in text input if(txt.value == '') { if(last_choice(menu)) { alert('you need to type your choice into the text box'); return false; } else { return true; } }//end if else { //check if user entered text although he did not select last option if(!last_choice(menu)) { alert('incompatible selection'); return false; } else { return true; } } } 39

40 Note on HTML5 Validation If you want to disable client side validation for a form in HTML5 add a novalidate attribute to the form element. Ex: <form method="post" action="/foo" novalidate>...</form> 40

41 Review of Event Registration model 1-inline event registration model: event handlers are added as attributes to the HTML elements they were working on, like: <input type= Button onclick= m1() > 2-Traditional event registration model : The onclick, onmouseover and all other event properties of the HTML element are completely accessible through JavaScript. After you have properly accessed the HTML element through a you can write your function into the property of your choice, like: element.onclick = dosomething; note that in the registration of an event handler you do not use parentheses Ø To remove the event handler, simply make the onclick method empty: element.onclick = null; Ø The handler can be also an anonymous function element.onclick = function () {startdragdrop(); spyonuser()}

42 If an element and one of its ancestors have an event handler for the same event, which one should fire first? If the user clicks on element2 he causes a click event in both element1 and element2. But which event fires first?

43 3-The W3C event registration model :Advanced event registration models object.addeventlistener (eventname, function, usecapture); Ø to register dosomething() function to the onclick of an element you do: element.addeventlistener('click',dosomething,false) Ø we can add as many event listeners as we want to the element. element.addeventlistener('click',startdragdrop,false) element.addeventlistener('click',spyonuser,false) Ø You can also use anonymous functions element.addeventlistener('click', function () { this.style.backgroundcolor = '#cc0000' },false) Ø As to the true or false that is the last argument of addeventlistener, it is meant to state whether the event handler should be executed in the capturing (true) or in the bubbling phase Web Ref: Programming CS333 CS614

Introduction to DHTML

Introduction to DHTML Introduction to DHTML HTML is based on thinking of a web page like a printed page: a document that is rendered once and that is static once rendered. The idea behind Dynamic HTML (DHTML), however, is to

More information

JavaScript and XHTML. Prof. D. Krupesha, PESIT, Bangalore

JavaScript and XHTML. Prof. D. Krupesha, PESIT, Bangalore JavaScript and XHTML Prof. D. Krupesha, PESIT, Bangalore Why is JavaScript Important? It is simple and lots of scripts available in public domain and easy to use. It is used for client-side scripting.

More information

By the end of this section of the practical, the students should be able to:

By the end of this section of the practical, the students should be able to: By the end of this section of the practical, the students should be able to: Learn about the Document Object Model and the Document Object Model hierarchy Create and use the properties, methods and event

More information

Web Programming/Scripting: JavaScript

Web Programming/Scripting: JavaScript CS 312 Internet Concepts Web Programming/Scripting: JavaScript Dr. Michele Weigle Department of Computer Science Old Dominion University mweigle@cs.odu.edu http://www.cs.odu.edu/~mweigle/cs312-f11/ 1 Outline!

More information

COMP519 Web Programming Lecture 16: JavaScript (Part 7) Handouts

COMP519 Web Programming Lecture 16: JavaScript (Part 7) Handouts COMP519 Web Programming Lecture 16: JavaScript (Part 7) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

More information

IS 242 Web Application Development I

IS 242 Web Application Development I IS 242 Web Application Development I Lecture 11: Introduction to JavaScript (Part 4) Marwah Alaofi Outlines of today s lecture Events Assigning events using DOM Dom nodes Browser Object Model (BOM) 2 Event

More information

Web Site Development with HTML/JavaScrip

Web Site Development with HTML/JavaScrip Hands-On Web Site Development with HTML/JavaScrip Course Description This Hands-On Web programming course provides a thorough introduction to implementing a full-featured Web site on the Internet or corporate

More information

CITS3403 Agile Web Development Semester 1, 2018

CITS3403 Agile Web Development Semester 1, 2018 Javascript Event Handling CITS3403 Agile Web Development Semester 1, 2018 Event Driven Programming Event driven programming or event based programming programming paradigm in which the flow of the program

More information

Produced by. App Development & Modeling. BSc in Applied Computing. Eamonn de Leastar

Produced by. App Development & Modeling. BSc in Applied Computing. Eamonn de Leastar App Development & Modeling BSc in Applied Computing Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

More information

Q1. What is JavaScript?

Q1. What is JavaScript? Q1. What is JavaScript? JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight programming language JavaScript is usually embedded

More information

DOM Primer Part 2. Contents

DOM Primer Part 2. Contents DOM Primer Part 2 Contents 1. Event Programming 1.1 Event handlers 1.2 Event types 1.3 Structure modification 2. Forms 2.1 Introduction 2.2 Scripting interface to input elements 2.2.1 Form elements 2.2.2

More information

Forms, Form Events, and Validation. Bok, Jong Soon

Forms, Form Events, and Validation. Bok, Jong Soon Forms, Form Events, and Validation Bok, Jong Soon jongsoon.bok@gmail.com www.javaexpert.co.kr How to Access to Form In JavaScript, access forms through the Document Object Model (DOM). The first approach

More information

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018)

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018) COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018) RAMANA ISUKAPALLI RAMANA@CS.COLUMBIA.EDU 1 LECTURE-1 Course overview See http://www.cs.columbia.edu/~ramana Overview of HTML Formatting, headings,

More information

CSC Javascript

CSC Javascript CSC 4800 Javascript See book! Javascript Syntax How to embed javascript between from an external file In an event handler URL - bookmarklet

More information

INLEDANDE WEBBPROGRAMMERING MED JAVASCRIPT INTRODUCTION TO WEB PROGRAMING USING JAVASCRIPT

INLEDANDE WEBBPROGRAMMERING MED JAVASCRIPT INTRODUCTION TO WEB PROGRAMING USING JAVASCRIPT INLEDANDE WEBBPROGRAMMERING MED JAVASCRIPT INTRODUCTION TO WEB PROGRAMING USING JAVASCRIPT ME152A L4: 1. HIGHER ORDER FUNCTIONS 2. REGULAR EXPRESSIONS 3. JAVASCRIPT - HTML 4. DOM AND EVENTS OUTLINE What

More information

Client vs Server Scripting

Client vs Server Scripting Client vs Server Scripting PHP is a server side scripting method. Why might server side scripting not be a good idea? What is a solution? We could try having the user download scripts that run on their

More information

5. JavaScript Basics

5. JavaScript Basics CHAPTER 5: JavaScript Basics 88 5. JavaScript Basics 5.1 An Introduction to JavaScript A Programming language for creating active user interface on Web pages JavaScript script is added in an HTML page,

More information

Programming the Web VALIDATING FORM INPUT

Programming the Web VALIDATING FORM INPUT VALIDATING FORM INPUT One of the common uses of JavaScript is to check the values provided in forms by users to determine whether the values are sensible. When a user fills in a form input element incorrectly

More information

HTML Form. Kanida Sinmai

HTML Form. Kanida Sinmai HTML Form Kanida Sinmai ksinmai@tsu.ac.th http://mis.csit.sci.tsu.ac.th/kanida HTML Form HTML forms are used to collect user input. The element defines an HTML form: . form elements. Form

More information

JavaScript s role on the Web

JavaScript s role on the Web Chris Panayiotou JavaScript s role on the Web JavaScript Programming Language Developed by Netscape for use in Navigator Web Browsers Purpose make web pages (documents) more dynamic and interactive Change

More information

The first sample. What is JavaScript?

The first sample. What is JavaScript? Java Script Introduction JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari. In this lecture

More information

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data"

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data CS 418/518 Web Programming Spring 2014 HTML Tables and Forms Dr. Michele Weigle http://www.cs.odu.edu/~mweigle/cs418-s14/ Outline! Assigned Reading! Chapter 4 "Using Tables to Display Data"! Chapter 5

More information

CE212 Web Application Programming Part 2

CE212 Web Application Programming Part 2 CE212 Web Application Programming Part 2 22/01/2018 CE212 Part 2 1 JavaScript Event-Handlers 1 JavaScript may be invoked to handle input events on HTML pages, e.g.

More information

CSI 3140 WWW Structures, Techniques and Standards. Browsers and the DOM

CSI 3140 WWW Structures, Techniques and Standards. Browsers and the DOM CSI 3140 WWW Structures, Techniques and Standards Browsers and the DOM Overview The Document Object Model (DOM) is an API that allows programs to interact with HTML (or XML) documents In typical browsers,

More information

Session 16. JavaScript Part 1. Reading

Session 16. JavaScript Part 1. Reading Session 16 JavaScript Part 1 1 Reading Reading Wikipedia en.wikipedia.org/wiki/javascript / p W3C www.w3.org/tr/rec-html40/interact/scripts.html Web Developers Notes www.webdevelopersnotes.com/tutorials/javascript/

More information

Events: another simple example

Events: another simple example Internet t Software Technologies Dynamic HTML part two IMCNE A.A. 2008/09 Gabriele Cecchetti Events: another simple example Every element on a web page has certain events which can trigger JavaScript functions.

More information

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB Unit 8 HTML Forms and Basic CGI Slides based on course material SFU Icons their respective owners 1 Learning Objectives In this unit you will

More information

Chapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL

Chapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL Chapter4: HTML Table and Script page, HTML5 new forms Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL Objective To know HTML5 creating a new style form. To understand HTML table benefits

More information

Session 6. JavaScript Part 1. Reading

Session 6. JavaScript Part 1. Reading Session 6 JavaScript Part 1 Reading Reading Wikipedia en.wikipedia.org/wiki/javascript Web Developers Notes www.webdevelopersnotes.com/tutorials/javascript/ JavaScript Debugging www.w3schools.com/js/js_debugging.asp

More information

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010 Lecture 21 Javascript Announcements Reminder: beginning with Homework #7, Javascript assignments must be submitted using a format described in an attachment to HW#7 3rd Exam date set for 12/14 in Goessmann

More information

Introduction to using HTML to design webpages

Introduction to using HTML to design webpages Introduction to using HTML to design webpages #HTML is the script that web pages are written in. It describes the content and structure of a web page so that a browser is able to interpret and render the

More information

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser.

Controlled Assessment Task. Question 1 - Describe how this HTML code produces the form displayed in the browser. Controlled Assessment Task Question 1 - Describe how this HTML code produces the form displayed in the browser. The form s code is displayed in the tags; this creates the object which is the visible

More information

INTRODUCTION TO WEB DEVELOPMENT AND HTML. Lecture 13: Intro to JavaScript - Spring 2011

INTRODUCTION TO WEB DEVELOPMENT AND HTML. Lecture 13: Intro to JavaScript - Spring 2011 INTRODUCTION TO WEB DEVELOPMENT AND HTML Lecture 13: Intro to JavaScript - Spring 2011 Outline Intro to JavaScript What is JavaScript? JavaScript!= Java Intro to JavaScript JavaScript is a lightweight

More information

JavaScript!= Java. Intro to JavaScript. What is JavaScript? Intro to JavaScript 4/17/2013 INTRODUCTION TO WEB DEVELOPMENT AND HTML

JavaScript!= Java. Intro to JavaScript. What is JavaScript? Intro to JavaScript 4/17/2013 INTRODUCTION TO WEB DEVELOPMENT AND HTML INTRODUCTION TO WEB DEVELOPMENT AND HTML Intro to JavaScript Lecture 13: Intro to JavaScript - Spring 2013 What is JavaScript? JavaScript!= Java Intro to JavaScript JavaScript is a lightweight programming

More information

Photo from DOM

Photo from  DOM Photo from http://www.flickr.com/photos/emraya/2861149369/ DOM 2 DOM When a browser reads an HTML file, it must interpret the file and render it onscreen. This process is sophisticated. Fetch Parse Flow

More information

Interactor Tree. Edith Law & Mike Terry

Interactor Tree. Edith Law & Mike Terry Interactor Tree Edith Law & Mike Terry Today s YouTube Break https://www.youtube.com/watch?v=mqqo-iog4qw Routing Events to Widgets Say I click on the CS349 button, which produces a mouse event that is

More information

HTML and JavaScript: Forms and Validation

HTML and JavaScript: Forms and Validation HTML and JavaScript: Forms and Validation CISC 282 October 18, 2017 Forms Collection of specific elements know as controls Allow the user to enter information Submit the data to a web server Controls are

More information

Place User-Defined Functions in the HEAD Section

Place User-Defined Functions in the HEAD Section JavaScript Functions Notes (Modified from: w3schools.com) A function is a block of code that will be executed when "someone" calls it. In JavaScript, we can define our own functions, called user-defined

More information

Best Practices Chapter 5

Best Practices Chapter 5 Best Practices Chapter 5 Chapter 5 CHRIS HOY 12/11/2015 COMW-283 Chapter 5 The DOM and BOM The BOM stand for the Browser Object Model, it s also the client-side of the web hierarchy. It is made up of a

More information

Summary 4/5. (contains info about the html)

Summary 4/5. (contains info about the html) Summary Tag Info Version Attributes Comment 4/5

More information

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI INDEX No. Title Pag e No. 1 Implements Basic HTML Tags 3 2 Implementation Of Table Tag 4 3 Implementation Of FRAMES 5 4 Design A FORM

More information

<form>. input elements. </form>

<form>. input elements. </form> CS 183 4/8/2010 A form is an area that can contain form elements. Form elements are elements that allow the user to enter information (like text fields, text area fields, drop-down menus, radio buttons,

More information

<body> <form id="myform" name="myform"> <!-- form child elements go in here --> </form> </body>

<body> <form id=myform name=myform> <!-- form child elements go in here --> </form> </body> ITEC 136 Business Programming Concepts Week 08, Part 01 Overview 1 Week 7 Review Sentinel controlled loops Results controlled loops Flag controlled loops break and continue keywords Nested loops Loop variable

More information

JavaScript II CSCI 311 SPRING 2017

JavaScript II CSCI 311 SPRING 2017 JavaScript II CSCI 311 SPRING 2017 Overview Look at more JavaScript functionality DOM slide show preloading images pull down menus and more! Document Object Model DOM gives us ways to access elements of

More information

Document Object Model (DOM)

Document Object Model (DOM) Document Object Model (DOM) HTML DOM The Document Object Model is a platform- and language-neutral interface that will allow programs and scripts to dynamically access and update the content, structure

More information

Hyperlinks, Tables, Forms and Frameworks

Hyperlinks, Tables, Forms and Frameworks Hyperlinks, Tables, Forms and Frameworks Web Authoring and Design Benjamin Kenwright Outline Review Previous Material HTML Tables, Forms and Frameworks Summary Review/Discussion Email? Did everyone get

More information

Javascript Lecture 23

Javascript Lecture 23 Javascript Lecture 23 Robb T. Koether Hampden-Sydney College Mar 9, 2012 Robb T. Koether (Hampden-Sydney College) JavascriptLecture 23 Mar 9, 2012 1 / 23 1 Javascript 2 The Document Object Model (DOM)

More information

PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore WEB PROGRAMMING Solution Set II

PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore WEB PROGRAMMING Solution Set II PES DEGREE COLLEGE BANGALORE SOUTH CAMPUS 1 K.M. before Electronic City, Bangalore 560 100 WEB PROGRAMMING Solution Set II Section A 1. This function evaluates a string as javascript statement or expression

More information

Overview. Event Handling. Introduction. Reviewing the load Event. Event mousemove and the event Object. Rollovers with mouseover and mouseout

Overview. Event Handling. Introduction. Reviewing the load Event. Event mousemove and the event Object. Rollovers with mouseover and mouseout Overview Introduction Reviewing the load Event Event mousemove and the event Object Rollovers with mouseover and mouseout Form processing with focus, blur, submit, reset More events Introduction The Document

More information

blink.html 1/1 lectures/6/src/ form.html 1/1 lectures/6/src/

blink.html 1/1 lectures/6/src/ form.html 1/1 lectures/6/src/ blink.html 1/1 3: blink.html 5: David J. Malan Computer Science E-75 7: Harvard Extension School 8: 9: --> 11:

More information

JAVASCRIPT HTML DOM. The HTML DOM Tree of Objects. JavaScript HTML DOM 1/14

JAVASCRIPT HTML DOM. The HTML DOM Tree of Objects. JavaScript HTML DOM 1/14 JAVASCRIPT HTML DOM The HTML DOM Tree of Objects JavaScript HTML DOM 1/14 ALL ELEMENTS ARE OBJECTS JavaScript can change all the HTML elements in the page JavaScript can change all the HTML attributes

More information

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1)

JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 6 Professional Program: Data Administration and Management JAVASCRIPT AND JQUERY: AN INTRODUCTION (WEB PROGRAMMING, X452.1) AGENDA

More information

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application. Extra notes - Client-side Design and Development Dr Nick Hayward HTML - Basics A brief introduction to some of the basics of HTML. Contents Intro element add some metadata define a base address

More information

Tizen Web UI Technologies (Tizen Ver. 2.3)

Tizen Web UI Technologies (Tizen Ver. 2.3) Tizen Web UI Technologies (Tizen Ver. 2.3) Spring 2015 Soo Dong Kim, Ph.D. Professor, Department of Computer Science Software Engineering Laboratory Soongsil University Office 02-820-0909 Mobile 010-7392-2220

More information

Fundamentals of Website Development

Fundamentals of Website Development Fundamentals of Website Development CSC 2320, Fall 2015 The Department of Computer Science Events handler Element with attribute onclick. Onclick with call function Function defined in your script or library.

More information

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0 WEB TECHNOLOGIES A COMPUTER SCIENCE PERSPECTIVE CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0 Modified by Ahmed Sallam Based on original slides by Jeffrey C. Jackson reserved. 0-13-185603-0 HTML HELLO WORLD! Document

More information

CISH-6510 Web Application Design and Development. Overview of JavaScript. Overview

CISH-6510 Web Application Design and Development. Overview of JavaScript. Overview CISH-6510 Web Application Design and Development Overview of JavaScript Overview What is JavaScript? History Uses of JavaScript Location of Code Simple Alert Example Events Events Example Color Example

More information

LAB Test 1. Rules and Regulations:-

LAB Test 1. Rules and Regulations:- LAB Test 1 Rules and Regulations:- 1. Individual Test 2. Start at 3.10 pm until 4.40 pm (1 Hour and 30 Minutes) 3. Open note test 4. Send the answer to h.a.sulaiman@ieee.org a. Subject: [LabTest] Your

More information

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes Course Title Course Code WEB DESIGNING TECHNOLOGIES DCE311 Lecture : 3 Course Credit Practical : Tutorial : 0 Total : 5 Course Learning Outcomes At end of the course, students will be able to: Understand

More information

CITS1231 Web Technologies

CITS1231 Web Technologies CITS1231 Web Technologies Client side id Form Validation using JavaScript Objectives Recall how to create forms on web pages Understand the need for client side validation Know how to reference form elements

More information

Client-side Techniques. Client-side Techniques HTML/XHTML. Static web pages, Interactive web page: without depending on interaction with a server

Client-side Techniques. Client-side Techniques HTML/XHTML. Static web pages, Interactive web page: without depending on interaction with a server Client-side Techniques Client-side Techniques Static web pages, Interactive web page: without depending on interaction with a server HTML/XHTML: content Cascading Style Sheet (CSS): style and layout Script

More information

jquery - Other Selectors In jquery the selectors are defined inside the $(" ") jquery wrapper also you have to use single quotes jquery wrapper.

jquery - Other Selectors In jquery the selectors are defined inside the $( ) jquery wrapper also you have to use single quotes jquery wrapper. jquery - Other Selectors In jquery the selectors are defined inside the $(" ") jquery wrapper also you have to use single quotes jquery wrapper. There are different types of jquery selectors available

More information

JavaScript CSCI 201 Principles of Software Development

JavaScript CSCI 201 Principles of Software Development JavaScript CSCI 201 Principles of Software Development Jeffrey Miller, Ph.D. jeffrey.miller@usc.edu Outline JavaScript Program USC CSCI 201L JavaScript JavaScript is a front-end interpreted language that

More information

Dynamic HTML becomes HTML5. HTML Forms and Server Processing. Form Submission to Web Server. DHTML - Mouse Events. CMST385: Slide Set 8: Forms

Dynamic HTML becomes HTML5. HTML Forms and Server Processing. Form Submission to Web Server. DHTML - Mouse Events. CMST385: Slide Set 8: Forms HTML Forms and Server Processing Forms provide a standard data entry method for users to send information to a web server Clicking button calls a script on server CGI = Common Gateway Interface CGI scripts

More information

jquery Tutorial for Beginners: Nothing But the Goods

jquery Tutorial for Beginners: Nothing But the Goods jquery Tutorial for Beginners: Nothing But the Goods Not too long ago I wrote an article for Six Revisions called Getting Started with jquery that covered some important things (concept-wise) that beginning

More information

Dynamic Form Processing Tool Version 5.0 November 2014

Dynamic Form Processing Tool Version 5.0 November 2014 Dynamic Form Processing Tool Version 5.0 November 2014 Need more help, watch the video! Interlogic Graphics & Marketing (719) 884-1137 This tool allows an ICWS administrator to create forms that will be

More information

Document Object Model. Overview

Document Object Model. Overview Overview The (DOM) is a programming interface for HTML or XML documents. Models document as a tree of nodes. Nodes can contain text and other nodes. Nodes can have attributes which include style and behavior

More information

Chapter 16. JavaScript 3: Functions Table of Contents

Chapter 16. JavaScript 3: Functions Table of Contents Chapter 16. JavaScript 3: Functions Table of Contents Objectives... 2 14.1 Introduction... 2 14.1.1 Introduction to JavaScript Functions... 2 14.1.2 Uses of Functions... 2 14.2 Using Functions... 2 14.2.1

More information

HTML User Interface Controls. Interactive HTML user interfaces. Document Object Model (DOM)

HTML User Interface Controls. Interactive HTML user interfaces. Document Object Model (DOM) Page 1 HTML User Interface Controls CSE 190 M (Web Programming), Spring 2007 University of Washington Reading: Sebesta Ch. 5 sections 5.1-5.7.2, Ch. 2 sections 2.9-2.9.4 Interactive HTML user interfaces

More information

3Lesson 3: Functions, Methods and Events in JavaScript Objectives

3Lesson 3: Functions, Methods and Events in JavaScript Objectives 3Lesson 3: Functions, Methods and Events in JavaScript Objectives By the end of this lesson, you will be able to: 1.3.1: Use methods as. 1.3.2: Define. 1.3.3: Use data type conversion methods. 1.3.4: Call.

More information

Programmazione Web a.a. 2017/2018 HTML5

Programmazione Web a.a. 2017/2018 HTML5 Programmazione Web a.a. 2017/2018 HTML5 PhD Ing.Antonino Raucea antonino.raucea@dieei.unict.it 1 Introduzione HTML HTML is the standard markup language for creating Web pages. HTML stands for Hyper Text

More information

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010

Javascript. UNIVERSITY OF MASSACHUSETTS AMHERST CMPSCI 120 Fall 2010 Lecture 22 Javascript Announcements Homework#7 now due 11/24 at noon Reminder: beginning with Homework #7, Javascript assignments must be submitted using a format described in an attachment to HW#7 I will

More information

write vs. writeln Prompting as Page Loads Today s Goals CSCI 2910 Client/Server-Side Programming Intermediate File vs. HTML Output

write vs. writeln Prompting as Page Loads Today s Goals CSCI 2910 Client/Server-Side Programming Intermediate File vs. HTML Output CSCI 2910 Client/Server-Side Programming Topic: JavaScript Part 2 Today s Goals Today s lecture will cover: More objects, properties, and methods of the DOM The Math object Introduction to form validation

More information

Syllabus - July to Sept

Syllabus - July to Sept Class IX Sub: Computer Syllabus - July to Sept What is www: The World Wide Web (www, W3) is an information space where documents and other web resources are identified by URIs, interlinked by hypertext

More information

710 Index Attributes, 127 action attribute, 263 assigning, bottom attribute, domain name attribute, 481 expiration date attribute, 480 8

710 Index Attributes, 127 action attribute, 263 assigning, bottom attribute, domain name attribute, 481 expiration date attribute, 480 8 INDEX Symbols = (assignment operator), 56 \ (backslash), 33 \b (backspace), 33 \" (double quotation mark), 32 \e (escape), 33 \f (form feed), 33

More information

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script

What is Java Script? Writing to The HTML Document. What Can JavaScript do? CMPT 165: Java Script What is Java Script? CMPT 165: Java Script Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University November 7, 2011 JavaScript was designed to add interactivity to HTML pages

More information

1. Cascading Style Sheet and JavaScript

1. Cascading Style Sheet and JavaScript 1. Cascading Style Sheet and JavaScript Cascading Style Sheet or CSS allows you to specify styles for visual element of the website. Styles specify the appearance of particular page element on the screen.

More information

HTML Forms. By Jaroslav Mohapl

HTML Forms. By Jaroslav Mohapl HTML Forms By Jaroslav Mohapl Abstract How to write an HTML form, create control buttons, a text input and a text area. How to input data from a list of items, a drop down list, and a list box. Simply

More information

Loops/Confirm Tutorial:

Loops/Confirm Tutorial: Loops/Confirm Tutorial: What you ve learned so far: 3 ways to call a function how to write a function how to send values into parameters in a function How to create an array (of pictures, of sentences,

More information

HTML 5 and CSS 3, Illustrated Complete. Unit L: Programming Web Pages with JavaScript

HTML 5 and CSS 3, Illustrated Complete. Unit L: Programming Web Pages with JavaScript HTML 5 and CSS 3, Illustrated Complete Unit L: Programming Web Pages with JavaScript Objectives Explore the Document Object Model Add content using a script Trigger a script using an event handler Create

More information

New Perspectives on Creating Web Pages with HTML. Tutorial Objectives

New Perspectives on Creating Web Pages with HTML. Tutorial Objectives New Perspectives on Creating Web Pages with HTML Tutorial 9: Working with JavaScript Objects and Events 1 Tutorial Objectives Learn about form validation Study the object-based nature of the JavaScript

More information

Introduction to JavaScript

Introduction to JavaScript 127 Lesson 14 Introduction to JavaScript Aim Objectives : To provide an introduction about JavaScript : To give an idea about, What is JavaScript? How to create a simple JavaScript? More about Java Script

More information

Session 7. JavaScript Part 2. W3C DOM Reading and Reference

Session 7. JavaScript Part 2. W3C DOM Reading and Reference Session 7 JavaScript Part 2 W3C DOM Reading and Reference Background and introduction developer.mozilla.org/en-us/docs/dom/dom_reference/introduction en.wikipedia.org/wiki/document_object_model www.w3schools.com/js/js_htmldom.asp

More information

Outline. Lecture 4: Document Object Model (DOM) What is DOM Traversal and Modification Events and Event Handling

Outline. Lecture 4: Document Object Model (DOM) What is DOM Traversal and Modification Events and Event Handling Outline Lecture 4: Document Object Model (DOM) What is DOM Traversal and Modification Events and Event Handling Wendy Liu CSC309F Fall 2007 1 2 Document Object Model (DOM) An defined application programming

More information

JavaScript Introduction

JavaScript Introduction JavaScript Introduction Web Technologies I. Zsolt Tóth University of Miskolc 2016 Zsolt Tóth (UM) JavaScript Introduction 2016 1 / 31 Introduction Table of Contents 1 Introduction 2 Syntax Variables Control

More information

JAVASCRIPT. JavaScript is the programming language of HTML and the Web. JavaScript Java. JavaScript is interpreted by the browser.

JAVASCRIPT. JavaScript is the programming language of HTML and the Web. JavaScript Java. JavaScript is interpreted by the browser. JAVASCRIPT JavaScript is the programming language of HTML and the Web. JavaScript Java JavaScript is interpreted by the browser JavaScript 1/15 JS WHERE TO

More information

Networking and Internet

Networking and Internet Today s Topic Lecture 13 Web Fundamentals Networking and Internet LAN Web pages Web resources Web client Web Server HTTP Protocol HTML & HTML Forms 1 2 LAN (Local Area Network) Networking and Internet

More information

CIS 339 Section 2. What is JavaScript

CIS 339 Section 2. What is JavaScript CIS 339 Section 2 Introduction to JavaScript 9/26/2001 2001 Paul Wolfgang 1 What is JavaScript An interpreted programming language with object-oriented capabilities. Shares its syntax with Java, C++, and

More information

Web Engineering (Lecture 06) JavaScript part 2

Web Engineering (Lecture 06) JavaScript part 2 Web Engineering (Lecture 06) JavaScript part 2 By: Mr. Sadiq Shah Lecturer (CS) Class BS(IT)-6 th semester JavaScript Events HTML events are "things" that happen to HTML elements. javascript lets you execute

More information

Session 17. jquery. jquery Reading & References

Session 17. jquery. jquery Reading & References Session 17 jquery 1 Tutorials jquery Reading & References http://learn.jquery.com/about-jquery/how-jquery-works/ http://www.tutorialspoint.com/jquery/ http://www.referencedesigner.com/tutorials/jquery/jq_1.php

More information

JavaScript Handling Events Page 1

JavaScript Handling Events Page 1 JavaScript Handling Events Page 1 1 2 3 4 5 6 7 8 Handling Events JavaScript JavaScript Events (Page 1) An HTML event is something interesting that happens to an HTML element Can include: Web document

More information

Then there are methods ; each method describes an action that can be done to (or with) the object.

Then there are methods ; each method describes an action that can be done to (or with) the object. When the browser loads a page, it stores it in an electronic form that programmers can then access through something known as an interface. The interface is a little like a predefined set of questions

More information

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6 CS 350 COMPUTER/HUMAN INTERACTION Lecture 6 Setting up PPP webpage Log into lab Linux client or into csserver directly Webspace (www_home) should be set up Change directory for CS 350 assignments cp r

More information

EECS1012. Net-centric Introduction to Computing. Lecture JavaScript Events

EECS1012. Net-centric Introduction to Computing. Lecture JavaScript Events EECS 1012 Net-centric Introduction to Computing Lecture JavaScript Events Acknowledgements Contents are adapted from web lectures for Web Programming Step by Step, by M. Stepp, J. Miller, and V. Kirst.

More information

Web Designing HTML5 NOTES

Web Designing HTML5 NOTES Web Designing HTML5 NOTES HTML Introduction What is HTML? HTML is the standard markup language for creating Web pages. HTML stands for Hyper Text Markup Language HTML describes the structure of Web pages

More information

JavaScript code is inserted between tags, just like normal HTML tags:

JavaScript code is inserted between tags, just like normal HTML tags: Introduction to JavaScript In this lesson we will provide a brief introduction to JavaScript. We won t go into a ton of detail. There are a number of good JavaScript tutorials on the web. What is JavaScript?

More information

Manual Html A Href Onclick Submit Form

Manual Html A Href Onclick Submit Form Manual Html A Href Onclick Submit Form JS HTML DOM. DOM Intro DOM Methods HTML form validation can be done by a JavaScript. If a form field _input type="submit" value="submit" /form_. As shown in a previous

More information

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0

CSI 3140 WWW Structures, Techniques and Standards. Markup Languages: XHTML 1.0 CSI 3140 WWW Structures, Techniques and Standards Markup Languages: XHTML 1.0 HTML Hello World! Document Type Declaration Document Instance Guy-Vincent Jourdan :: CSI 3140 :: based on Jeffrey C. Jackson

More information