SlideShare a Scribd company logo
1 of 29
Basics of HTML (Hyper Text 
Markup Language) 
 HTML is used to render Web pages 
Rendering may differ from a browser to another 
It has no computation power and should include 
some Scripting language, like Java Script or 
VBScript to produce User interactive Rendering 
Pages 
Despite several design tools, we should learn 
some basics of HTML to be good web 
developer. 
Monday, October 13, 2014sohamsengupta@yahoo.com 1
Some basic tags of HTML 
The MIME type is text/html (details on MIME 
later on) 
Apart from <html>, <head>, <title>, <body>, and 
6 heading tags like <h1>
<h6>, we have tags 
like <form>, <b>, <u>, <i>, <a>, <ul>, <ol>, 
<table>, <input>, <select> et al, to mention a 
few. 
Not all these tags require closing, but it’s a good 
practice to close all tags when over. 
Most of the tags have attributes, and it’s a 
common malpractice to avoid double/single 
quotes enclosing the attribute values. 
Monday, October 13, 2014sohamsengupta@yahoo.com 2
Hey Man! Quotes Must! 
 For Example, <input type=“text” 
name=“fname” value=“Aditya Narayan”> is 
Okay. 
But, not the following one
 <input 
type=text name=fname value=Aditya 
Narayan> 
In the second case, for some browsers 
shall truncate the part Narayan from the 
field. 
Monday, October 13, 2014sohamsengupta@yahoo.com 3
Form Tag and its Importance 
 The main power of Web is how easily and fast it 
interacts with the server and processes the user 
inputs, and what transfers data from the client to 
the server is the <FORM> tag. 
It defines mainly 2 attributes, though not 
mandatory but expected, are action and 
method. By default method is GET (details later) 
The action contains the URL that the FORM is 
submitted to and transfers the user-input data to. 
Form may contain some <input> field as shown 
in next slide, some <select> field, and a Submit 
Button or a Button leading to the Submit event. 
Monday, October 13, 2014sohamsengupta@yahoo.com 4
Inside a <FORM> tag <html><head><title>Welcome to JISCE</title></head><body> 
<form action=http://myhost:myport/myURI><pre> 
Enter name: <input type=“text” name=“myName”> 
Enter ID: <input type=“text” name=“myId”> 
<select name=“mySkill”> 
<option value=“Java SE”>Java SE 1.4</option> 
<option value=“Java EE”>Java EE 1.4</option> 
<option value=“Java ME”>Java 2 ME </option></select> 
Gender <input type=“radio” name=“mySex” value=“Male”>Male 
<input type=“radio” name=“mySex” value=“Female”>Female 
Check if already registerd <input type=“checkbox” 
name=“regStatus” value=“regd”> 
<input type=“Submit” value=“Done”></pre> 
</form> 
</body> 
</html> 
View At the Code above rendered in IE 6 
Monday, October 13, 2014sohamsengupta@yahoo.com 5
Inside the <INPUT> tag 
<INPUT> tags don’t need to be closed. 
With this, we can take any text data, password, 
checkbox, radio button, Submit Button, Hidden 
Form Field, Any Button, A File to Upload etc. 
The mandatory “type” attribute determines what 
the INPUT is going to render. 
 Example, <input type=“text” name=“fname”> 
The name attribute is must, too. It lets the server 
fetch the data “fname” from the data entered 
here 
More on these follows
 
Monday, October 13, 2014sohamsengupta@yahoo.com 6
More on <INPUT> tag 
<input type=“password” name=“pwd”> 
<input type=“radio” name=“sex” value=“Male”> 
Male 
<input type=“radio” name=“sex” 
value=“Female”>Female 
The above 2 radios must have same name 
else both can be selected at time that’s not desired 
The value attribute must be present with radios 
and You have to render, too; else the user shall 
not see what’s for what option. The 2 need not 
be same. 
Monday, October 13, 2014sohamsengupta@yahoo.com 7
<INPUT> tag
contd. 
 <input type=“checkbox” name=“skill” value=“Java 
SE”>Java SE 
<input type=“checkbox” name=“skill” value=“Java 
EE”>J2EE 
<input type=“checkbox” name=“skill” value=“Java 
ME”>J2ME 
 Check boxes with same name can be multi-checked at 
a single time. They must have values and the rendered 
text should be there to tell the user what’s what option 
and the value attribute may not be same as the text 
rendered. The server shall accept the value attribute’s 
values. 
 Here, the server shall consider the “Java EE” but not the 
rendered text J2EE. 
Monday, October 13, 2014sohamsengupta@yahoo.com 8
<INPUT> tag
 contd. 
<input type=“hidden” name=“hdn1” 
value=“logged”> This shall not be 
rendered in the browser but are often 
required for Session tracking (details later) 
<input type=“submit” value=“Done”> 
<input type=“button” name=“btn1” 
value=“Click”> 
<input type=“file” name=“upldFile”> shall 
open a File type input on browsing. 
Monday, October 13, 2014sohamsengupta@yahoo.com 9
<select> Tag as Drop-down list 
<select name=“skill”> 
<option value=“Java”>Java</option> 
<option value=“CPP”>C++</option> 
<option value=“C#”>C-Sharp</option> 
</select> 
It should have a name, so to let the server 
retrieve the data skill from the form, after it’s 
submitted. 
Also, Server shall get the value “CPP”, not “C-Sharp” 
Monday, October 13, 2014sohamsengupta@yahoo.com 10
Java Script for Client Side 
Validation 
Sometimes, you can’t rest assured with the data 
that the user inputs through the client browsers 
as they have to pass several validation and 
conform to certain constraints. Like, the user 
may be required to fill up all the fields in the form 
and then submit. Also, the user may input some 
Alphabets where only numeric data is required. 
All these things must be taken care of by the 
server side program. 
But, better if we could check them at the client 
side, thus saving the time of a round-trip to the 
server. Scripting languages like JavaScript used. 
Monday, October 13, 2014sohamsengupta@yahoo.com 11
A Simple Form validation with Java 
Script 
<script language=“JavaScript”> 
function chkForm(){ 
var msg=“”; 
if(document.forms[0].myName.value==“”){ 
msg+=“Name can’t be blank!n”; 
} 
if(document.forms[0].myCity.value==“”){ 
msg+=“City can’t be blank!”; 
} 
if(msg==“”) return true; 
else{ 
alert(msg); 
return false; 
} 
} 
</script> 
Monday, October 13, 2014sohamsengupta@yahoo.com 12
The HTML Code 
<body> 
<form action=“myURL” onsubmit=“return chkForm()”> 
Enter Name: <input type=“text” name=“myName”> 
<br>Enter City: <input type=“text” name=“myCity”> 
<input type=“submit” value=“Submit”> 
</form> 
</body> 
</html> 
FormValidation.html 
 onsubmit=“return chkForm()” Note the return 
keyword, without which it’d not work! 
Monday, October 13, 2014sohamsengupta@yahoo.com 13
Brief history of JavaScript 
Netscape developed a scripting language called LiveScript 
Supported both client side and server side scripting 
Netscape Navigator 2 
(support for java applets and LiveScript 
renamed as JavaScript1.1) 
Microsoft- JScript IE 3 
1997 ECMA (European 
Computer Manufacturers 
Association) 
Standardized ECMA script 
Opera 
supporting 
JavaScript 1.1 
W3C standardized DOM to access HTML and XML 
JavaScript 1.2 
Monday, October 13, 2014sohamsengupta@yahoo.com 14
Programs 
executes on the 
server and sends 
the response 
Response 
HTML file 
JAVA 
SCRIPT 
Request 
Client Web Server 
Script 
executes 
locally and 
interacts with 
the browser 
Monday, October 13, 2014sohamsengupta@yahoo.com 15 
Servlet files 
JSP files 
HTML files
Uses 
‱ To create more interactive pages- client side validations etc. 
‱ To generate html dynamically. 
‱ Event handling 
‱ To enhance browser capabilities by giving it a better look – 
printing on status bar etc. 
‱ Interaction with embedded components like applets and active 
x controls. 
Language Features 
‱ Object based language:no object inheritance and subclassing. Object -based 
because it depends on built-in objects to function. 
‱ Semicolon, as separator for multiple statements in the same line. 
‱ Syntax similar to c++ and java 
‱ Case sensitive 
‱ Loosely typed 
‱ Platform independent 
‱ Interpreted 
Monday, October 13, 2014sohamsengupta@yahoo.com 16
External Script 
<HTML> 
<HEAD> 
<BODY> 
<SCRIPT LANGUAGE=“JavaScript” 
SRC=“JSfile.js”> 
</SCRIPT> 
</BODY> 
</HTML> 
JSfile.js 
document.write(“Hello”) 
Scripts inside body and head 
Inside head only declarations should be done. No write 
statements must appear inside head tag. 
<HTML><HEAD><TITLE>Hello</TITLE> 
<SCRIPT> 
document.write(“Hello java script”) 
</SCRIPT> 
</HEAD> 
<BODY></BODY> 
</HTML> 
Incorrect 
Monday, October 13, 2014sohamsengupta@yahoo.com 17
Java Script Data Type and Scope 
 Java Script is loosely typed and it 
supports Data Types like String, Date, 
Array etc. and totally objects. 
 A variable defined with keyword var 
inside a function is a local variable. 
Otherwise it has scope global to the entire 
HTML page. 
 We, however, must not indulge in the 
luxury of dealing with Language basics. 
Monday, October 13, 2014sohamsengupta@yahoo.com 18
A Simple variable and function 
example 
<html><head></head> 
<script> 
age=90; 
function fun(){ 
age=26; 
alert("Age = "+age); 
} 
</script> 
<input type="button" value="Show Age" onclick="fun()"> 
<input type="button" value="Show Age12" onclick="sd()"> 
<script> 
function sd(){ 
alert("Age = "+age); 
} 
</script> 
<body> 
</body></html> See this execute 
Monday, October 13, 2014sohamsengupta@yahoo.com 19
Continuation to The Code 
 Here age has global scope. Now if we modify 
the code as including 
function fun(){ 
var age=26; 
alert("Age = "+age); 
} we shall get different output. 
 If we omit the statement age=90; we get different 
situation. But if we associate a var with age, it’d be same. 
 After this example we not only got to learn about the scope of 
variables, but we proved that declaring a variable with var 
keyword doesn’t always localize it. 
Monday, October 13, 2014sohamsengupta@yahoo.com 20
Event handling with Java Script 
 There’s nothing like consulting the 
documentation of Java Script. We shall learn to 
use Java Script with HTML with hands-on 
practice. 
Sometimes we shall need to embed Java Script 
in HTML and position elements dynamically. 
Some event-handlers: onclick, onkeyup, 
onkeypress, onkeydown, ondblclick, onchange, 
Following shall be some assignments we’d 
discuss. 
Monday, October 13, 2014sohamsengupta@yahoo.com 21
Assignments on Java Script Event 
Handling-1 
There’ll be a form having 2 text fields and 
a checkbox. The 2nd text needs only 
numbers. So, Typing sans numeric shall 
not be allowed. Now, the checkbox if 
checked, on clicking the submit button, the 
browser will ask for confirmation whether 
to submit or not. If both the fields are not 
filled up, the form shall never be 
submitted. 
Monday, October 13, 2014sohamsengupta@yahoo.com 22
Assignments on Java Script Event 
Handling-2,3 
 There should be a Hyper link that links to a 
page. As you make the mouse cursor go over 
the link, it’d change font color and size. As you 
mouse-out, it should be restored. 
 There should be a form that takes 2 text fields, 
name and Phone No. The Phone No. must be 
numeric. Also, there should be a checkbox 
asking for if there is an alternative phone 
Number to be provided, which, when checked, 
will display another text field taking only 
numbers and un-checking will make it disappear. 
Monday, October 13, 2014sohamsengupta@yahoo.com 23
Assignments on Java Script Event 
Handling-4,5 
 There should be a text area, and you can type 
up to 100 characters. As you keep on typing, a 
text indicating how many characters more 
remain, shall be displayed continuously. 
There should be 2 text fields taking two 
numbers. A button should be there disabled until 
both the text fields are filled up. However, if you 
delete any of the numbers, the button should 
become disabled again. Otherwise, clicking the 
button, the sum should be displayed. 
Monday, October 13, 2014sohamsengupta@yahoo.com 24
Frames and Java Script: 
Assignment 
 There should be 2 frames on a page. The LHS 
frame should contain link to a page say 2.html, 
in various ways, to open in the same and parent 
frames, in a new window, and in the same 
window. The page 2.html, would have buttons to 
close the window in various ways. 
 You would need some knowledge on DHTML 
and Cascading Style Sheets (css) to solve some 
of the assignments. So, the next few slides 
follow
 
Monday, October 13, 2014sohamsengupta@yahoo.com 25
Three ways to include style 
‱ Embedded style 
‱ Inline style 
‱ Linked styles 
Setting up style info- an example 
Microsoft way 
BODY { font: 12 pt Arial; color: navy; margin-left: 
0.25in } 
H1 { font: 18 pt Arial; color: red } 
Monday, October 13, 2014sohamsengupta@yahoo.com 26
Embedded style : <Style> tag 
<html><head> 
<style type="text/css"> 
BODY { font: 12 pt Arial; color: navy; margin-left: 0.25in} 
H1 { font: 18 pt Arial; color: red} 
</style> 
</head> 
<body> 
<h1>Dynamic Web Pages</h1> 
The need of dynamic web pages; an overview of DHTML, 
cascading style sheet, comparative studies of different 
technologies of 
dynamic page creation 
</body></html> 
Monday, October 13, 2014sohamsengupta@yahoo.com 27
Inline style 
<table style="font: 12 pt Arial; color: green; font-weight: 
bold"> 
<tr><td>Name</td><td>Reg No. </td></tr> 
<tr><td>XXXX</td><td>55555</td></tr> 
</table> 
Monday, October 13, 2014sohamsengupta@yahoo.com 28
Linked style 
‱ Linking to a style info in a separate file. 
BODY { font: 12 pt Arial; color: navy; margin-left: 
0.25in} 
H1 { font: 18 pt Arial; color: red} 
Monday, October 13, 2014sohamsengupta@yahoo.com 29 
style.cs 
s 
<html><head> 
<link rel=“stylesheet” href=“style.css”> 
</head> 
<body><h1>Dynamic Web Pages</h1> 
The need of dynamic web pages; an overview of 
DHTML,cascading style sheet, comparative studies of 
different technologies of dynamic page creation 
</body></html>

More Related Content

What's hot

HTL(Sightly) - All you need to know
HTL(Sightly) - All you need to knowHTL(Sightly) - All you need to know
HTL(Sightly) - All you need to knowPrabhdeep Singh
 
A quick guide to Css and java script
A quick guide to Css and  java scriptA quick guide to Css and  java script
A quick guide to Css and java scriptAVINASH KUMAR
 
Java script Basic
Java script BasicJava script Basic
Java script BasicJaya Kumari
 
Learn html and css from scratch
Learn html and css from scratchLearn html and css from scratch
Learn html and css from scratchMohd Manzoor Ahmed
 
Building Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan DieboltBuilding Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan DieboltQuickBase, Inc.
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentalsRajiv Gupta
 
AEM Sightly Template Language
AEM Sightly Template LanguageAEM Sightly Template Language
AEM Sightly Template LanguageGabriel Walt
 
Java script
Java scriptJava script
Java scriptITz_1
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshellLennart Schoors
 
Understanding JSP -Servlets
Understanding JSP -ServletsUnderstanding JSP -Servlets
Understanding JSP -ServletsGagandeep Singh
 
Java script
Java scriptJava script
Java scriptJay Patel
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScriptAndres Baravalle
 

What's hot (20)

HTL(Sightly) - All you need to know
HTL(Sightly) - All you need to knowHTL(Sightly) - All you need to know
HTL(Sightly) - All you need to know
 
Sightly - Part 2
Sightly - Part 2Sightly - Part 2
Sightly - Part 2
 
Java script
Java scriptJava script
Java script
 
Html JavaScript and CSS
Html JavaScript and CSSHtml JavaScript and CSS
Html JavaScript and CSS
 
A quick guide to Css and java script
A quick guide to Css and  java scriptA quick guide to Css and  java script
A quick guide to Css and java script
 
Java script Basic
Java script BasicJava script Basic
Java script Basic
 
Learn html and css from scratch
Learn html and css from scratchLearn html and css from scratch
Learn html and css from scratch
 
Building Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan DieboltBuilding Smart Workflows - Dan Diebolt
Building Smart Workflows - Dan Diebolt
 
Javascript
JavascriptJavascript
Javascript
 
1. java script language fundamentals
1. java script language fundamentals1. java script language fundamentals
1. java script language fundamentals
 
AEM Sightly Template Language
AEM Sightly Template LanguageAEM Sightly Template Language
AEM Sightly Template Language
 
Jsp
JspJsp
Jsp
 
Java script
Java scriptJava script
Java script
 
Html 5 in a big nutshell
Html 5 in a big nutshellHtml 5 in a big nutshell
Html 5 in a big nutshell
 
Javascript
JavascriptJavascript
Javascript
 
Understanding JSP -Servlets
Understanding JSP -ServletsUnderstanding JSP -Servlets
Understanding JSP -Servlets
 
Java script
Java scriptJava script
Java script
 
Web 2.0
Web 2.0Web 2.0
Web 2.0
 
Java script
Java scriptJava script
Java script
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 

Similar to Html javascript

Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptdominion
 
CHAPTER 3 JS (1).pptx
CHAPTER 3  JS (1).pptxCHAPTER 3  JS (1).pptx
CHAPTER 3 JS (1).pptxachutachut
 
Introduction of javascript
Introduction of javascriptIntroduction of javascript
Introduction of javascriptsyeda zoya mehdi
 
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08Tim Stephenson
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsEugene Andruszczenko
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryRefresh Events
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSPablo Godel
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)SANTOSH RATH
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesTikal Knowledge
 
Automated Testing Of Web Applications Using XML
Automated  Testing Of  Web  Applications Using  XMLAutomated  Testing Of  Web  Applications Using  XML
Automated Testing Of Web Applications Using XMLdiongillard
 
Final Java-script.pptx
Final Java-script.pptxFinal Java-script.pptx
Final Java-script.pptxAlkanthiSomesh
 
Html5 CSS3 jQuery Basic
Html5 CSS3 jQuery BasicHtml5 CSS3 jQuery Basic
Html5 CSS3 jQuery BasicRavi Yelluripati
 
PPT on javascript ajax and css and some points related to server
PPT on javascript ajax and css and some points related to serverPPT on javascript ajax and css and some points related to server
PPT on javascript ajax and css and some points related to servershivanichourasia01
 
JavaScripts & jQuery
JavaScripts & jQueryJavaScripts & jQuery
JavaScripts & jQueryAsanka Indrajith
 
Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applicationsdominion
 

Similar to Html javascript (20)

Wt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technologyWt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technology
 
Advisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScriptAdvisor Jumpstart: JavaScript
Advisor Jumpstart: JavaScript
 
CHAPTER 3 JS (1).pptx
CHAPTER 3  JS (1).pptxCHAPTER 3  JS (1).pptx
CHAPTER 3 JS (1).pptx
 
Introduction of javascript
Introduction of javascriptIntroduction of javascript
Introduction of javascript
 
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
 
JavaScript
JavaScriptJavaScript
JavaScript
 
jQuery Presentation - Refresh Events
jQuery Presentation - Refresh EventsjQuery Presentation - Refresh Events
jQuery Presentation - Refresh Events
 
Eugene Andruszczenko: jQuery
Eugene Andruszczenko: jQueryEugene Andruszczenko: jQuery
Eugene Andruszczenko: jQuery
 
Tek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJSTek 2013 - Building Web Apps from a New Angle with AngularJS
Tek 2013 - Building Web Apps from a New Angle with AngularJS
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Iwt note(module 2)
Iwt note(module 2)Iwt note(module 2)
Iwt note(module 2)
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
 
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With DeadlinesJBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
 
Automated Testing Of Web Applications Using XML
Automated  Testing Of  Web  Applications Using  XMLAutomated  Testing Of  Web  Applications Using  XML
Automated Testing Of Web Applications Using XML
 
Java scipt
Java sciptJava scipt
Java scipt
 
Final Java-script.pptx
Final Java-script.pptxFinal Java-script.pptx
Final Java-script.pptx
 
Html5 CSS3 jQuery Basic
Html5 CSS3 jQuery BasicHtml5 CSS3 jQuery Basic
Html5 CSS3 jQuery Basic
 
PPT on javascript ajax and css and some points related to server
PPT on javascript ajax and css and some points related to serverPPT on javascript ajax and css and some points related to server
PPT on javascript ajax and css and some points related to server
 
JavaScripts & jQuery
JavaScripts & jQueryJavaScripts & jQuery
JavaScripts & jQuery
 
Using Ajax In Domino Web Applications
Using Ajax In Domino Web ApplicationsUsing Ajax In Domino Web Applications
Using Ajax In Domino Web Applications
 

More from Soham Sengupta

Spring method-level-secuirty
Spring method-level-secuirtySpring method-level-secuirty
Spring method-level-secuirtySoham Sengupta
 
Spring security mvc-1
Spring security mvc-1Spring security mvc-1
Spring security mvc-1Soham Sengupta
 
JavaScript event handling assignment
JavaScript  event handling assignment JavaScript  event handling assignment
JavaScript event handling assignment Soham Sengupta
 
Networking assignment 2
Networking assignment 2Networking assignment 2
Networking assignment 2Soham Sengupta
 
Networking assignment 1
Networking assignment 1Networking assignment 1
Networking assignment 1Soham Sengupta
 
Sohams cryptography basics
Sohams cryptography basicsSohams cryptography basics
Sohams cryptography basicsSoham Sengupta
 
Network programming1
Network programming1Network programming1
Network programming1Soham Sengupta
 
JSR-82 Bluetooth tutorial
JSR-82 Bluetooth tutorialJSR-82 Bluetooth tutorial
JSR-82 Bluetooth tutorialSoham Sengupta
 
Java.lang.object
Java.lang.objectJava.lang.object
Java.lang.objectSoham Sengupta
 
Soham web security
Soham web securitySoham web security
Soham web securitySoham Sengupta
 
Html tables and_javascript
Html tables and_javascriptHtml tables and_javascript
Html tables and_javascriptSoham Sengupta
 

More from Soham Sengupta (20)

Spring method-level-secuirty
Spring method-level-secuirtySpring method-level-secuirty
Spring method-level-secuirty
 
Spring security mvc-1
Spring security mvc-1Spring security mvc-1
Spring security mvc-1
 
JavaScript event handling assignment
JavaScript  event handling assignment JavaScript  event handling assignment
JavaScript event handling assignment
 
Networking assignment 2
Networking assignment 2Networking assignment 2
Networking assignment 2
 
Networking assignment 1
Networking assignment 1Networking assignment 1
Networking assignment 1
 
Sohams cryptography basics
Sohams cryptography basicsSohams cryptography basics
Sohams cryptography basics
 
Network programming1
Network programming1Network programming1
Network programming1
 
JSR-82 Bluetooth tutorial
JSR-82 Bluetooth tutorialJSR-82 Bluetooth tutorial
JSR-82 Bluetooth tutorial
 
Xmpp and java
Xmpp and javaXmpp and java
Xmpp and java
 
Core java day2
Core java day2Core java day2
Core java day2
 
Core java day1
Core java day1Core java day1
Core java day1
 
Core java day4
Core java day4Core java day4
Core java day4
 
Core java day5
Core java day5Core java day5
Core java day5
 
Exceptions
ExceptionsExceptions
Exceptions
 
Java.lang.object
Java.lang.objectJava.lang.object
Java.lang.object
 
Jsp1
Jsp1Jsp1
Jsp1
 
Soham web security
Soham web securitySoham web security
Soham web security
 
Html tables and_javascript
Html tables and_javascriptHtml tables and_javascript
Html tables and_javascript
 
Sohamsg ajax
Sohamsg ajaxSohamsg ajax
Sohamsg ajax
 
Dhtml
DhtmlDhtml
Dhtml
 

Recently uploaded

What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfkalichargn70th171
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Lecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptLecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptesrabilgic2
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 

Recently uploaded (20)

What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>àŒ’+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdfExploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
Exploring Selenium_Appium Frameworks for Seamless Integration with HeadSpin.pdf
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Lecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).pptLecture # 8 software design and architecture (SDA).ppt
Lecture # 8 software design and architecture (SDA).ppt
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 

Html javascript

  • 1. Basics of HTML (Hyper Text Markup Language)  HTML is used to render Web pages Rendering may differ from a browser to another It has no computation power and should include some Scripting language, like Java Script or VBScript to produce User interactive Rendering Pages Despite several design tools, we should learn some basics of HTML to be good web developer. Monday, October 13, 2014sohamsengupta@yahoo.com 1
  • 2. Some basic tags of HTML The MIME type is text/html (details on MIME later on) Apart from <html>, <head>, <title>, <body>, and 6 heading tags like <h1>
<h6>, we have tags like <form>, <b>, <u>, <i>, <a>, <ul>, <ol>, <table>, <input>, <select> et al, to mention a few. Not all these tags require closing, but it’s a good practice to close all tags when over. Most of the tags have attributes, and it’s a common malpractice to avoid double/single quotes enclosing the attribute values. Monday, October 13, 2014sohamsengupta@yahoo.com 2
  • 3. Hey Man! Quotes Must!  For Example, <input type=“text” name=“fname” value=“Aditya Narayan”> is Okay. But, not the following one
 <input type=text name=fname value=Aditya Narayan> In the second case, for some browsers shall truncate the part Narayan from the field. Monday, October 13, 2014sohamsengupta@yahoo.com 3
  • 4. Form Tag and its Importance  The main power of Web is how easily and fast it interacts with the server and processes the user inputs, and what transfers data from the client to the server is the <FORM> tag. It defines mainly 2 attributes, though not mandatory but expected, are action and method. By default method is GET (details later) The action contains the URL that the FORM is submitted to and transfers the user-input data to. Form may contain some <input> field as shown in next slide, some <select> field, and a Submit Button or a Button leading to the Submit event. Monday, October 13, 2014sohamsengupta@yahoo.com 4
  • 5. Inside a <FORM> tag <html><head><title>Welcome to JISCE</title></head><body> <form action=http://myhost:myport/myURI><pre> Enter name: <input type=“text” name=“myName”> Enter ID: <input type=“text” name=“myId”> <select name=“mySkill”> <option value=“Java SE”>Java SE 1.4</option> <option value=“Java EE”>Java EE 1.4</option> <option value=“Java ME”>Java 2 ME </option></select> Gender <input type=“radio” name=“mySex” value=“Male”>Male <input type=“radio” name=“mySex” value=“Female”>Female Check if already registerd <input type=“checkbox” name=“regStatus” value=“regd”> <input type=“Submit” value=“Done”></pre> </form> </body> </html> View At the Code above rendered in IE 6 Monday, October 13, 2014sohamsengupta@yahoo.com 5
  • 6. Inside the <INPUT> tag <INPUT> tags don’t need to be closed. With this, we can take any text data, password, checkbox, radio button, Submit Button, Hidden Form Field, Any Button, A File to Upload etc. The mandatory “type” attribute determines what the INPUT is going to render.  Example, <input type=“text” name=“fname”> The name attribute is must, too. It lets the server fetch the data “fname” from the data entered here More on these follows
 Monday, October 13, 2014sohamsengupta@yahoo.com 6
  • 7. More on <INPUT> tag <input type=“password” name=“pwd”> <input type=“radio” name=“sex” value=“Male”> Male <input type=“radio” name=“sex” value=“Female”>Female The above 2 radios must have same name else both can be selected at time that’s not desired The value attribute must be present with radios and You have to render, too; else the user shall not see what’s for what option. The 2 need not be same. Monday, October 13, 2014sohamsengupta@yahoo.com 7
  • 8. <INPUT> tag
contd.  <input type=“checkbox” name=“skill” value=“Java SE”>Java SE <input type=“checkbox” name=“skill” value=“Java EE”>J2EE <input type=“checkbox” name=“skill” value=“Java ME”>J2ME  Check boxes with same name can be multi-checked at a single time. They must have values and the rendered text should be there to tell the user what’s what option and the value attribute may not be same as the text rendered. The server shall accept the value attribute’s values.  Here, the server shall consider the “Java EE” but not the rendered text J2EE. Monday, October 13, 2014sohamsengupta@yahoo.com 8
  • 9. <INPUT> tag
 contd. <input type=“hidden” name=“hdn1” value=“logged”> This shall not be rendered in the browser but are often required for Session tracking (details later) <input type=“submit” value=“Done”> <input type=“button” name=“btn1” value=“Click”> <input type=“file” name=“upldFile”> shall open a File type input on browsing. Monday, October 13, 2014sohamsengupta@yahoo.com 9
  • 10. <select> Tag as Drop-down list <select name=“skill”> <option value=“Java”>Java</option> <option value=“CPP”>C++</option> <option value=“C#”>C-Sharp</option> </select> It should have a name, so to let the server retrieve the data skill from the form, after it’s submitted. Also, Server shall get the value “CPP”, not “C-Sharp” Monday, October 13, 2014sohamsengupta@yahoo.com 10
  • 11. Java Script for Client Side Validation Sometimes, you can’t rest assured with the data that the user inputs through the client browsers as they have to pass several validation and conform to certain constraints. Like, the user may be required to fill up all the fields in the form and then submit. Also, the user may input some Alphabets where only numeric data is required. All these things must be taken care of by the server side program. But, better if we could check them at the client side, thus saving the time of a round-trip to the server. Scripting languages like JavaScript used. Monday, October 13, 2014sohamsengupta@yahoo.com 11
  • 12. A Simple Form validation with Java Script <script language=“JavaScript”> function chkForm(){ var msg=“”; if(document.forms[0].myName.value==“”){ msg+=“Name can’t be blank!n”; } if(document.forms[0].myCity.value==“”){ msg+=“City can’t be blank!”; } if(msg==“”) return true; else{ alert(msg); return false; } } </script> Monday, October 13, 2014sohamsengupta@yahoo.com 12
  • 13. The HTML Code <body> <form action=“myURL” onsubmit=“return chkForm()”> Enter Name: <input type=“text” name=“myName”> <br>Enter City: <input type=“text” name=“myCity”> <input type=“submit” value=“Submit”> </form> </body> </html> FormValidation.html  onsubmit=“return chkForm()” Note the return keyword, without which it’d not work! Monday, October 13, 2014sohamsengupta@yahoo.com 13
  • 14. Brief history of JavaScript Netscape developed a scripting language called LiveScript Supported both client side and server side scripting Netscape Navigator 2 (support for java applets and LiveScript renamed as JavaScript1.1) Microsoft- JScript IE 3 1997 ECMA (European Computer Manufacturers Association) Standardized ECMA script Opera supporting JavaScript 1.1 W3C standardized DOM to access HTML and XML JavaScript 1.2 Monday, October 13, 2014sohamsengupta@yahoo.com 14
  • 15. Programs executes on the server and sends the response Response HTML file JAVA SCRIPT Request Client Web Server Script executes locally and interacts with the browser Monday, October 13, 2014sohamsengupta@yahoo.com 15 Servlet files JSP files HTML files
  • 16. Uses ‱ To create more interactive pages- client side validations etc. ‱ To generate html dynamically. ‱ Event handling ‱ To enhance browser capabilities by giving it a better look – printing on status bar etc. ‱ Interaction with embedded components like applets and active x controls. Language Features ‱ Object based language:no object inheritance and subclassing. Object -based because it depends on built-in objects to function. ‱ Semicolon, as separator for multiple statements in the same line. ‱ Syntax similar to c++ and java ‱ Case sensitive ‱ Loosely typed ‱ Platform independent ‱ Interpreted Monday, October 13, 2014sohamsengupta@yahoo.com 16
  • 17. External Script <HTML> <HEAD> <BODY> <SCRIPT LANGUAGE=“JavaScript” SRC=“JSfile.js”> </SCRIPT> </BODY> </HTML> JSfile.js document.write(“Hello”) Scripts inside body and head Inside head only declarations should be done. No write statements must appear inside head tag. <HTML><HEAD><TITLE>Hello</TITLE> <SCRIPT> document.write(“Hello java script”) </SCRIPT> </HEAD> <BODY></BODY> </HTML> Incorrect Monday, October 13, 2014sohamsengupta@yahoo.com 17
  • 18. Java Script Data Type and Scope  Java Script is loosely typed and it supports Data Types like String, Date, Array etc. and totally objects.  A variable defined with keyword var inside a function is a local variable. Otherwise it has scope global to the entire HTML page.  We, however, must not indulge in the luxury of dealing with Language basics. Monday, October 13, 2014sohamsengupta@yahoo.com 18
  • 19. A Simple variable and function example <html><head></head> <script> age=90; function fun(){ age=26; alert("Age = "+age); } </script> <input type="button" value="Show Age" onclick="fun()"> <input type="button" value="Show Age12" onclick="sd()"> <script> function sd(){ alert("Age = "+age); } </script> <body> </body></html> See this execute Monday, October 13, 2014sohamsengupta@yahoo.com 19
  • 20. Continuation to The Code  Here age has global scope. Now if we modify the code as including function fun(){ var age=26; alert("Age = "+age); } we shall get different output.  If we omit the statement age=90; we get different situation. But if we associate a var with age, it’d be same.  After this example we not only got to learn about the scope of variables, but we proved that declaring a variable with var keyword doesn’t always localize it. Monday, October 13, 2014sohamsengupta@yahoo.com 20
  • 21. Event handling with Java Script  There’s nothing like consulting the documentation of Java Script. We shall learn to use Java Script with HTML with hands-on practice. Sometimes we shall need to embed Java Script in HTML and position elements dynamically. Some event-handlers: onclick, onkeyup, onkeypress, onkeydown, ondblclick, onchange, Following shall be some assignments we’d discuss. Monday, October 13, 2014sohamsengupta@yahoo.com 21
  • 22. Assignments on Java Script Event Handling-1 There’ll be a form having 2 text fields and a checkbox. The 2nd text needs only numbers. So, Typing sans numeric shall not be allowed. Now, the checkbox if checked, on clicking the submit button, the browser will ask for confirmation whether to submit or not. If both the fields are not filled up, the form shall never be submitted. Monday, October 13, 2014sohamsengupta@yahoo.com 22
  • 23. Assignments on Java Script Event Handling-2,3  There should be a Hyper link that links to a page. As you make the mouse cursor go over the link, it’d change font color and size. As you mouse-out, it should be restored.  There should be a form that takes 2 text fields, name and Phone No. The Phone No. must be numeric. Also, there should be a checkbox asking for if there is an alternative phone Number to be provided, which, when checked, will display another text field taking only numbers and un-checking will make it disappear. Monday, October 13, 2014sohamsengupta@yahoo.com 23
  • 24. Assignments on Java Script Event Handling-4,5  There should be a text area, and you can type up to 100 characters. As you keep on typing, a text indicating how many characters more remain, shall be displayed continuously. There should be 2 text fields taking two numbers. A button should be there disabled until both the text fields are filled up. However, if you delete any of the numbers, the button should become disabled again. Otherwise, clicking the button, the sum should be displayed. Monday, October 13, 2014sohamsengupta@yahoo.com 24
  • 25. Frames and Java Script: Assignment  There should be 2 frames on a page. The LHS frame should contain link to a page say 2.html, in various ways, to open in the same and parent frames, in a new window, and in the same window. The page 2.html, would have buttons to close the window in various ways.  You would need some knowledge on DHTML and Cascading Style Sheets (css) to solve some of the assignments. So, the next few slides follow
 Monday, October 13, 2014sohamsengupta@yahoo.com 25
  • 26. Three ways to include style ‱ Embedded style ‱ Inline style ‱ Linked styles Setting up style info- an example Microsoft way BODY { font: 12 pt Arial; color: navy; margin-left: 0.25in } H1 { font: 18 pt Arial; color: red } Monday, October 13, 2014sohamsengupta@yahoo.com 26
  • 27. Embedded style : <Style> tag <html><head> <style type="text/css"> BODY { font: 12 pt Arial; color: navy; margin-left: 0.25in} H1 { font: 18 pt Arial; color: red} </style> </head> <body> <h1>Dynamic Web Pages</h1> The need of dynamic web pages; an overview of DHTML, cascading style sheet, comparative studies of different technologies of dynamic page creation </body></html> Monday, October 13, 2014sohamsengupta@yahoo.com 27
  • 28. Inline style <table style="font: 12 pt Arial; color: green; font-weight: bold"> <tr><td>Name</td><td>Reg No. </td></tr> <tr><td>XXXX</td><td>55555</td></tr> </table> Monday, October 13, 2014sohamsengupta@yahoo.com 28
  • 29. Linked style ‱ Linking to a style info in a separate file. BODY { font: 12 pt Arial; color: navy; margin-left: 0.25in} H1 { font: 18 pt Arial; color: red} Monday, October 13, 2014sohamsengupta@yahoo.com 29 style.cs s <html><head> <link rel=“stylesheet” href=“style.css”> </head> <body><h1>Dynamic Web Pages</h1> The need of dynamic web pages; an overview of DHTML,cascading style sheet, comparative studies of different technologies of dynamic page creation </body></html>