Dhtml chapter2

FLYMAN TECHNOLOGY LIMITED
FLYMAN TECHNOLOGY LIMITEDdirector em FLYMAN TECHNOLOGY LIMITED
BIT05206 
DHTML
DHTML 
• DHTML is a combination of technologies 
used to create dynamic and interactive Web 
sites. 
– HTML - For creating text and image links and other 
page elements. 
– CSS - Style Sheets for further formatting of text and 
html plus other added features such as positioning 
and layering content. 
– JavaScript - The programming language that allows 
you to accesses and dynamically control the 
individual properties of both HTML and Style Sheets
Why DHTML 
• With DHTML you can create: 
– Animation 
– Pop-up menus 
– Inclusion of Web page content from external 
data sources 
– Elements that can be dragged and dropped 
within the Web page
Dhtml chapter2
HTML (Hyper Text Markup 
Language) 
• An HTML file is a text file containing small 
markup tags 
• The markup tags tell the Web browser how to 
display the page 
• An HTML file must have an htm or html file 
extension 
• An HTML file can be created using a simple 
text editor
<html> 
<head> 
HTML (cont.) 
<title>BIT05206-Lab1</title> 
</head> 
<body> 
This is Our First Test. 
<I>This text is Italic</I> 
gives technical information 
about the document, and 
specifies its title. Nothing 
that appears in the header 
section will be displayed by 
the browser. 
</body> 
</html> 
• Most tags have opening and closing tags: 
<html> </html>, <head> </head> 
• Only some don’t have it: <br>, <hr>, <img>
HTML
HTML 
• Some tags have attribute such as: 
<body bgcolor = “green"> 
– Attributes always come in name/value 
pairs like this: name="value". 
• Find out more of HTML Tags and their 
attributes 
• Special treatment for some characters 
&nbsp, &quot
<html> 
<head> 
<title>BIT05206 Lab1</title> 
</head> 
<body bgcolor =Red> 
<p align =center> <B> User Interface Design </B></p> 
<hr> 
<p>[1] Course Notes<br> 
<a href="http://www.ucc.ac.tz"> BIT05206</a> 
</p> 
</body> 
</html> 
HTML
HTML
Try it <body> 
<p>Student Marks<br> </p> 
<table width="100%" border="2"> 
<tr bgcolor="green"> 
<td>Student Number</td> 
<td>Student First Name </td> 
<td>Mark</td> 
</tr> 
<tr> 
<td>10</td> 
<td>Lily</td> 
<td>A+</td> 
</tr> 
<tr> 
<td>20</td> 
<td>Den</td> 
<td>C+</td> 
</tr> 
</table> 
</body>
HTML
Dhtml chapter2
CSS 
• CSS stands for Cascading Style 
Sheets 
• Styles define how to display HTML 
elements 
• Styles are normally stored in Style 
Sheets
CSS 
• External Style Sheets can save you a lot of work 
• External Style Sheets are stored in CSS files 
• Multiple style definitions will cascade into one 
• Why? Modularity  simplicity, usability, 
reusability, etc
CSS 
• Syntax 
– selector {property: value} 
• The selector is normally the HTML element/tag 
• the property is the attribute you wish to change, 
• and each property can take a value. 
• Three Method to specify 
– Tag Modfier 
– body {color: black} 
– p { text-align: center; color: black; 
font-family: arial }
CSS 
• Three Method to specify 
– Class Modifier 
• With the class selector you can define different 
styles for the same type of HTML element 
.center {text-align: center} 
<h1 class="center"> 
This heading will be center-aligned 
</h1> 
– The id Selector 
• With the id selector you can define the same style 
for different HTML elements 
• #green {color: green} 
<h1 id="green">Hello </h1> <p id="green">Some text</p>
CSS (cont.) 
• How to Insert a Style Sheet 
– Internal style 
• An internal style sheet should be used when a 
single document has a unique style. 
• You define internal styles in the head section by 
using the <style> 
– Inline Styles: Many of the Advantages are 
lost
CSS Example 
<Html> 
<head> 
<style type="text/css"> 
hr {color: green} 
p {margin-left: 20px} 
body {background-color:yellow} 
</style> 
</head> 
<body> 
<h1 style ="color =blue; text-align=center"> BIT05206 </h1> 
<hr> 
<p>DHTML tutorial</p> 
</body> 
</Html> 
Tag Modifier 
Inline
CSS Example
CSS (cont.) 
• How to Insert a Style Sheet 
– External Style Sheet ideal when the style is 
applied to many pages 
.css text 
file 
<head> 
<link rel="stylesheet" type="text/css“ href="mystyle.css" /> 
</head>
CSS example
CSS 
• Click for more details: 
CSS Tutorial.
Dhtml chapter2
JavaScript Introduction 
• JavaScript was designed to add interactivity to 
HTML pages 
• JavaScript is a scripting language (a scripting 
language is a lightweight programming 
language) 
• JavaScript embedded in a web browser 
connects through interfaces called Document 
Object Models (DOMs) to applications server-side 
and client-side. This allows interactivity and 
dynamicity.
JavaScript Introduction 
• A JavaScript is usually embedded directly into 
HTML pages 
• JavaScript is an interpreted language (means 
that scripts execute without preliminary 
compilation)
How to Put a JavaScript Into an 
HTML Page 
• Scripts in the body section: 
– Scripts to be executed when the 
page loads go in the body 
section.. 
<html> 
<body> 
<script type="text/javascript"> 
document.write("Hello World!") 
</script> 
</body> 
</html>
Java Script 
• Scripts in the head section: 
– Scripts to be executed when they are called, 
or when an event is triggered, go in the head 
section. 
<html> 
<head> 
<script type="text/javascript"> 
…….. 
</script> 
</head> 
</html>
Java Script 
• External JavaScript 
– Save the external JavaScript file with a .js file 
extension 
<script src="xxx.js"> </script> 
• Deals with web elements using Java command, 
– If statement 
– Variables 
– Loops 
– …….
JavaScript Examples 
<Html> 
<body> 
<script type="text/javascript"> 
var d=new Date() 
var timeh=d.getHours() 
var timem=d.getMinutes() 
document.bgColor=“red” 
document.write("the time is: ") 
document.write(timeh) 
document.write(":") 
document.write(timem) 
if (timeh>=12) 
document.write(" PM") 
else 
document.write(" AM") 
</script> 
</body>
JavaScript – function 
<html> 
<head> 
<script type="text/javascript"> 
function message() 
{ 
alert("Welcome guest!") 
} 
</script> 
</head> 
<body> 
<input type="button" value="View message" 
onclick="message()" /> 
</body> 
</html>
Java Script and DOM 
<html> 
<body> 
<h1 id="header">My header</h1> 
<script type="text/javascript"> 
document.getElementById('header').style.color="red" 
</script> 
<p><b>Note:</b> It is the script that changes the style of the element!</p> 
</body> 
</html>
More About DOM 
http://www.w3schools.com/htmldom/default.asp
Example Try it 
<html> 
<head> 
<script type="text/javascript"> 
function hide() 
{ 
document.getElementById('txt1').style.visibility ='hidden' 
} 
function show() 
{ 
document.getElementById('txt1').style.visibility = 'visible' 
} 
function format() 
{ 
document.getElementById('txt1').style.color = 'red' 
document.getElementById('txt1').style.fontSize = '20' 
document.getElementById('txt1').style.textAlign ="center" 
document.bgColor='green' 
}
Example (Cont) 
function reset() 
{ 
document.getElementById('txt1').style.color = 'black' 
document.getElementById('txt1').style.fontSize = '14' 
document.getElementById('txt1').style.visibility = 'visible' 
document.bgColor='white' 
document.getElementById('txt1').style.textAlign ="left" 
} 
</script 
</head> 
<body> 
<input type="text" id= "txt1"> 
<input type="button" value="Hide" onclick="hide()"> 
<input type="button" value="show" onclick="show()"> 
<input type="button" value="format" onclick="format()"> 
<input type="button" value="Reset" onclick="reset()"> 
</body> 
</html>
Next: go through all the 
examples and try them
1 de 36

Recomendados

DHTML por
DHTMLDHTML
DHTMLRavinder Kamboj
8.1K visualizações46 slides
Dhtml por
DhtmlDhtml
DhtmlSoham Sengupta
969 visualizações13 slides
Dhtml por
DhtmlDhtml
Dhtmlrahul kundu
7.8K visualizações10 slides
Unit 2 dhtml por
Unit 2 dhtmlUnit 2 dhtml
Unit 2 dhtmlSarthak Varshney
360 visualizações16 slides
Dhtml sohaib ch por
Dhtml sohaib chDhtml sohaib ch
Dhtml sohaib chSohaib Chaudhery
2.7K visualizações20 slides
Dhtml ppt (2) por
Dhtml ppt (2)Dhtml ppt (2)
Dhtml ppt (2)Rai Saheb Bhanwar Singh College Nasrullaganj
2K visualizações26 slides

Mais conteúdo relacionado

Mais procurados

DHTML - Dynamic HTML por
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTMLReem Alattas
1.3K visualizações21 slides
Dynamic HTML (DHTML) por
Dynamic HTML (DHTML)Dynamic HTML (DHTML)
Dynamic HTML (DHTML)Himanshu Kumar
9.5K visualizações19 slides
Html and dhtml por
Html and dhtmlHtml and dhtml
Html and dhtmlLaxmihhar Basti
399 visualizações8 slides
Introduction to DOM por
Introduction to DOMIntroduction to DOM
Introduction to DOMDaniel Bragais
1K visualizações24 slides
Document Object Model por
Document Object ModelDocument Object Model
Document Object Modelchomas kandar
14.3K visualizações73 slides
Dom structure por
Dom structureDom structure
Dom structurebaabtra.com - No. 1 supplier of quality freshers
993 visualizações18 slides

Mais procurados(19)

DHTML - Dynamic HTML por Reem Alattas
DHTML - Dynamic HTMLDHTML - Dynamic HTML
DHTML - Dynamic HTML
Reem Alattas1.3K visualizações
Dynamic HTML (DHTML) por Himanshu Kumar
Dynamic HTML (DHTML)Dynamic HTML (DHTML)
Dynamic HTML (DHTML)
Himanshu Kumar9.5K visualizações
Html and dhtml por Laxmihhar Basti
Html and dhtmlHtml and dhtml
Html and dhtml
Laxmihhar Basti399 visualizações
Introduction to DOM por Daniel Bragais
Introduction to DOMIntroduction to DOM
Introduction to DOM
Daniel Bragais1K visualizações
Document Object Model por chomas kandar
Document Object ModelDocument Object Model
Document Object Model
chomas kandar14.3K visualizações
Html n CSS por Sukrit Gupta
Html n CSSHtml n CSS
Html n CSS
Sukrit Gupta1.2K visualizações
Understanding the dom by Benedict Ayiko por Damalie Wasukira
Understanding the dom by Benedict AyikoUnderstanding the dom by Benedict Ayiko
Understanding the dom by Benedict Ayiko
Damalie Wasukira68 visualizações
Web Design L1 - Untagling the Web por mykella
Web Design L1 - Untagling the WebWeb Design L1 - Untagling the Web
Web Design L1 - Untagling the Web
mykella49 visualizações
Document Object Model por Mayur Mudgal
Document Object ModelDocument Object Model
Document Object Model
Mayur Mudgal2.7K visualizações
Document object model(dom) por rahul kundu
Document object model(dom)Document object model(dom)
Document object model(dom)
rahul kundu2K visualizações
Lab#2 overview of html por Yaowaluck Promdee
Lab#2 overview of htmlLab#2 overview of html
Lab#2 overview of html
Yaowaluck Promdee805 visualizações
Hushang Gaikwad por Hushnag Gaikwad
Hushang GaikwadHushang Gaikwad
Hushang Gaikwad
Hushnag Gaikwad300 visualizações
An Introduction to the DOM por Mindy McAdams
An Introduction to the DOMAn Introduction to the DOM
An Introduction to the DOM
Mindy McAdams4.6K visualizações
Introduction css por sagaroceanic11
Introduction cssIntroduction css
Introduction css
sagaroceanic11309 visualizações
Xhtml por Samir Sabry
XhtmlXhtml
Xhtml
Samir Sabry2.9K visualizações
15. session 15 data binding por Phúc Đỗ
15. session 15   data binding15. session 15   data binding
15. session 15 data binding
Phúc Đỗ808 visualizações
The Document Object Model por Khou Suylong
The Document Object ModelThe Document Object Model
The Document Object Model
Khou Suylong750 visualizações
11 Quiz related to HTML, CSS, JS and WP por Rashna Maharjan
11 Quiz related to HTML, CSS, JS and WP11 Quiz related to HTML, CSS, JS and WP
11 Quiz related to HTML, CSS, JS and WP
Rashna Maharjan230 visualizações

Similar a Dhtml chapter2

Unit 1wt por
Unit 1wtUnit 1wt
Unit 1wtvamsitricks
441 visualizações54 slides
Unit 1wt por
Unit 1wtUnit 1wt
Unit 1wtvamsi krishna
603 visualizações54 slides
Introduction to Bootstrap por
Introduction to BootstrapIntroduction to Bootstrap
Introduction to BootstrapRon Reiter
41.8K visualizações32 slides
HTML CSS by Anubhav Singh por
HTML CSS by Anubhav SinghHTML CSS by Anubhav Singh
HTML CSS by Anubhav SinghAnubhav659
483 visualizações147 slides
Html por
HtmlHtml
HtmlAlisha Kalidhar
1.5K visualizações44 slides
What is HTML - An Introduction to HTML (Hypertext Markup Language) por
What is HTML - An Introduction to HTML (Hypertext Markup Language)What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)Ahsan Rahim
1.8K visualizações39 slides

Similar a Dhtml chapter2(20)

Unit 1wt por vamsitricks
Unit 1wtUnit 1wt
Unit 1wt
vamsitricks441 visualizações
Unit 1wt por vamsi krishna
Unit 1wtUnit 1wt
Unit 1wt
vamsi krishna603 visualizações
Introduction to Bootstrap por Ron Reiter
Introduction to BootstrapIntroduction to Bootstrap
Introduction to Bootstrap
Ron Reiter41.8K visualizações
HTML CSS by Anubhav Singh por Anubhav659
HTML CSS by Anubhav SinghHTML CSS by Anubhav Singh
HTML CSS by Anubhav Singh
Anubhav659483 visualizações
Html por Alisha Kalidhar
HtmlHtml
Html
Alisha Kalidhar1.5K visualizações
What is HTML - An Introduction to HTML (Hypertext Markup Language) por Ahsan Rahim
What is HTML - An Introduction to HTML (Hypertext Markup Language)What is HTML - An Introduction to HTML (Hypertext Markup Language)
What is HTML - An Introduction to HTML (Hypertext Markup Language)
Ahsan Rahim1.8K visualizações
LIS3353 SP12 Week 4 por Amanda Case
LIS3353 SP12 Week 4LIS3353 SP12 Week 4
LIS3353 SP12 Week 4
Amanda Case168 visualizações
Basics of html for web development by software outsourcing company india por Jignesh Aakoliya
Basics of html for web development   by software outsourcing company indiaBasics of html for web development   by software outsourcing company india
Basics of html for web development by software outsourcing company india
Jignesh Aakoliya289 visualizações
Hypertext markup language(html) por Jayson Cortez
Hypertext markup language(html)Hypertext markup language(html)
Hypertext markup language(html)
Jayson Cortez1.7K visualizações
Caracteristicas Basicas De Htlm por Maria S Rivera
Caracteristicas Basicas De HtlmCaracteristicas Basicas De Htlm
Caracteristicas Basicas De Htlm
Maria S Rivera323 visualizações
Additional HTML por Doeun KOCH
Additional HTML Additional HTML
Additional HTML
Doeun KOCH512 visualizações
Html css java script basics All about you need por Dipen Parmar
Html css java script basics All about you needHtml css java script basics All about you need
Html css java script basics All about you need
Dipen Parmar1.3K visualizações
HTML Basic, CSS Basic, JavaScript basic. por Beqa Chacha
HTML Basic, CSS Basic, JavaScript basic.HTML Basic, CSS Basic, JavaScript basic.
HTML Basic, CSS Basic, JavaScript basic.
Beqa Chacha759 visualizações
BITM3730 9-12.pptx por MattMarino13
BITM3730 9-12.pptxBITM3730 9-12.pptx
BITM3730 9-12.pptx
MattMarino1312 visualizações
POLITEKNIK MALAYSIA por Aiman Hud
POLITEKNIK MALAYSIAPOLITEKNIK MALAYSIA
POLITEKNIK MALAYSIA
Aiman Hud120 visualizações
4. html css-java script-basics por Nikita Garg
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
Nikita Garg883 visualizações
4. html css-java script-basics por xu fag
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
xu fag490 visualizações
4. html css-java script-basics por Minea Chem
4. html css-java script-basics4. html css-java script-basics
4. html css-java script-basics
Minea Chem629 visualizações
HTML por Toni Kolev
HTMLHTML
HTML
Toni Kolev327 visualizações

Mais de FLYMAN TECHNOLOGY LIMITED

Flyman Technology Limited Introduction Presentation por
Flyman Technology Limited Introduction PresentationFlyman Technology Limited Introduction Presentation
Flyman Technology Limited Introduction PresentationFLYMAN TECHNOLOGY LIMITED
147 visualizações24 slides
Flyman Technology Limited (Mzumbe University Tanzania) por
Flyman Technology Limited (Mzumbe University Tanzania)Flyman Technology Limited (Mzumbe University Tanzania)
Flyman Technology Limited (Mzumbe University Tanzania)FLYMAN TECHNOLOGY LIMITED
229 visualizações14 slides
Flyman Technology Limited Tanzania por
Flyman Technology Limited TanzaniaFlyman Technology Limited Tanzania
Flyman Technology Limited TanzaniaFLYMAN TECHNOLOGY LIMITED
202 visualizações14 slides
Saadani national park 2015 por
Saadani national park 2015Saadani national park 2015
Saadani national park 2015FLYMAN TECHNOLOGY LIMITED
338 visualizações11 slides
Uuzaji wa mazao ya kuku wa asili por
Uuzaji wa mazao ya kuku wa asiliUuzaji wa mazao ya kuku wa asili
Uuzaji wa mazao ya kuku wa asiliFLYMAN TECHNOLOGY LIMITED
1.1K visualizações16 slides
Entrepreneurship manual BIT por
Entrepreneurship manual BITEntrepreneurship manual BIT
Entrepreneurship manual BITFLYMAN TECHNOLOGY LIMITED
572 visualizações41 slides

Mais de FLYMAN TECHNOLOGY LIMITED(20)

Flyman Technology Limited Introduction Presentation por FLYMAN TECHNOLOGY LIMITED
Flyman Technology Limited Introduction PresentationFlyman Technology Limited Introduction Presentation
Flyman Technology Limited Introduction Presentation
FLYMAN TECHNOLOGY LIMITED147 visualizações
Flyman Technology Limited (Mzumbe University Tanzania) por FLYMAN TECHNOLOGY LIMITED
Flyman Technology Limited (Mzumbe University Tanzania)Flyman Technology Limited (Mzumbe University Tanzania)
Flyman Technology Limited (Mzumbe University Tanzania)
FLYMAN TECHNOLOGY LIMITED229 visualizações
introduction to the document object model- Dom chapter5 por FLYMAN TECHNOLOGY LIMITED
introduction to the document object model- Dom chapter5introduction to the document object model- Dom chapter5
introduction to the document object model- Dom chapter5
FLYMAN TECHNOLOGY LIMITED892 visualizações

Último

Cocktail of Environments. How to Mix Test and Development Environments and St... por
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...Aleksandr Tarasov
26 visualizações135 slides
"Node.js Development in 2024: trends and tools", Nikita Galkin por
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin Fwdays
37 visualizações38 slides
MVP and prioritization.pdf por
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdfrahuldharwal141
40 visualizações8 slides
AI + Memoori = AIM por
AI + Memoori = AIMAI + Memoori = AIM
AI + Memoori = AIMMemoori
15 visualizações9 slides
CryptoBotsAI por
CryptoBotsAICryptoBotsAI
CryptoBotsAIchandureddyvadala199
42 visualizações5 slides
"Package management in monorepos", Zoltan Kochan por
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan KochanFwdays
37 visualizações18 slides

Último(20)

Cocktail of Environments. How to Mix Test and Development Environments and St... por Aleksandr Tarasov
Cocktail of Environments. How to Mix Test and Development Environments and St...Cocktail of Environments. How to Mix Test and Development Environments and St...
Cocktail of Environments. How to Mix Test and Development Environments and St...
Aleksandr Tarasov26 visualizações
"Node.js Development in 2024: trends and tools", Nikita Galkin por Fwdays
"Node.js Development in 2024: trends and tools", Nikita Galkin "Node.js Development in 2024: trends and tools", Nikita Galkin
"Node.js Development in 2024: trends and tools", Nikita Galkin
Fwdays37 visualizações
MVP and prioritization.pdf por rahuldharwal141
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdf
rahuldharwal14140 visualizações
AI + Memoori = AIM por Memoori
AI + Memoori = AIMAI + Memoori = AIM
AI + Memoori = AIM
Memoori15 visualizações
"Package management in monorepos", Zoltan Kochan por Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays37 visualizações
What is Authentication Active Directory_.pptx por HeenaMehta35
What is Authentication Active Directory_.pptxWhat is Authentication Active Directory_.pptx
What is Authentication Active Directory_.pptx
HeenaMehta3515 visualizações
Mobile Core Solutions & Successful Cases.pdf por IPLOOK Networks
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdf
IPLOOK Networks16 visualizações
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」 por PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
PC Cluster Consortium29 visualizações
Innovation & Entrepreneurship strategies in Dairy Industry por PervaizDar1
Innovation & Entrepreneurship strategies in Dairy IndustryInnovation & Entrepreneurship strategies in Dairy Industry
Innovation & Entrepreneurship strategies in Dairy Industry
PervaizDar139 visualizações
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And... por ShapeBlue
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
Enabling DPU Hardware Accelerators in XCP-ng Cloud Platform Environment - And...
ShapeBlue120 visualizações
Qualifying SaaS, IaaS.pptx por Sachin Bhandari
Qualifying SaaS, IaaS.pptxQualifying SaaS, IaaS.pptx
Qualifying SaaS, IaaS.pptx
Sachin Bhandari1.1K visualizações
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf por MichaelOLeary82
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdfAdopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
MichaelOLeary8213 visualizações
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... por Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro38 visualizações
NTGapps NTG LowCode Platform por Mustafa Kuğu
NTGapps NTG LowCode Platform NTGapps NTG LowCode Platform
NTGapps NTG LowCode Platform
Mustafa Kuğu474 visualizações
Business Analyst Series 2023 - Week 4 Session 7 por DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10152 visualizações
"Running students' code in isolation. The hard way", Yurii Holiuk por Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays38 visualizações
Optimizing Communication to Optimize Human Behavior - LCBM por Yaman Kumar
Optimizing Communication to Optimize Human Behavior - LCBMOptimizing Communication to Optimize Human Behavior - LCBM
Optimizing Communication to Optimize Human Behavior - LCBM
Yaman Kumar39 visualizações
Transcript: Redefining the book supply chain: A glimpse into the future - Tec... por BookNet Canada
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
Transcript: Redefining the book supply chain: A glimpse into the future - Tec...
BookNet Canada43 visualizações
KubeConNA23 Recap.pdf por MichaelOLeary82
KubeConNA23 Recap.pdfKubeConNA23 Recap.pdf
KubeConNA23 Recap.pdf
MichaelOLeary8228 visualizações

Dhtml chapter2

  • 2. DHTML • DHTML is a combination of technologies used to create dynamic and interactive Web sites. – HTML - For creating text and image links and other page elements. – CSS - Style Sheets for further formatting of text and html plus other added features such as positioning and layering content. – JavaScript - The programming language that allows you to accesses and dynamically control the individual properties of both HTML and Style Sheets
  • 3. Why DHTML • With DHTML you can create: – Animation – Pop-up menus – Inclusion of Web page content from external data sources – Elements that can be dragged and dropped within the Web page
  • 5. HTML (Hyper Text Markup Language) • An HTML file is a text file containing small markup tags • The markup tags tell the Web browser how to display the page • An HTML file must have an htm or html file extension • An HTML file can be created using a simple text editor
  • 6. <html> <head> HTML (cont.) <title>BIT05206-Lab1</title> </head> <body> This is Our First Test. <I>This text is Italic</I> gives technical information about the document, and specifies its title. Nothing that appears in the header section will be displayed by the browser. </body> </html> • Most tags have opening and closing tags: <html> </html>, <head> </head> • Only some don’t have it: <br>, <hr>, <img>
  • 8. HTML • Some tags have attribute such as: <body bgcolor = “green"> – Attributes always come in name/value pairs like this: name="value". • Find out more of HTML Tags and their attributes • Special treatment for some characters &nbsp, &quot
  • 9. <html> <head> <title>BIT05206 Lab1</title> </head> <body bgcolor =Red> <p align =center> <B> User Interface Design </B></p> <hr> <p>[1] Course Notes<br> <a href="http://www.ucc.ac.tz"> BIT05206</a> </p> </body> </html> HTML
  • 10. HTML
  • 11. Try it <body> <p>Student Marks<br> </p> <table width="100%" border="2"> <tr bgcolor="green"> <td>Student Number</td> <td>Student First Name </td> <td>Mark</td> </tr> <tr> <td>10</td> <td>Lily</td> <td>A+</td> </tr> <tr> <td>20</td> <td>Den</td> <td>C+</td> </tr> </table> </body>
  • 12. HTML
  • 14. CSS • CSS stands for Cascading Style Sheets • Styles define how to display HTML elements • Styles are normally stored in Style Sheets
  • 15. CSS • External Style Sheets can save you a lot of work • External Style Sheets are stored in CSS files • Multiple style definitions will cascade into one • Why? Modularity  simplicity, usability, reusability, etc
  • 16. CSS • Syntax – selector {property: value} • The selector is normally the HTML element/tag • the property is the attribute you wish to change, • and each property can take a value. • Three Method to specify – Tag Modfier – body {color: black} – p { text-align: center; color: black; font-family: arial }
  • 17. CSS • Three Method to specify – Class Modifier • With the class selector you can define different styles for the same type of HTML element .center {text-align: center} <h1 class="center"> This heading will be center-aligned </h1> – The id Selector • With the id selector you can define the same style for different HTML elements • #green {color: green} <h1 id="green">Hello </h1> <p id="green">Some text</p>
  • 18. CSS (cont.) • How to Insert a Style Sheet – Internal style • An internal style sheet should be used when a single document has a unique style. • You define internal styles in the head section by using the <style> – Inline Styles: Many of the Advantages are lost
  • 19. CSS Example <Html> <head> <style type="text/css"> hr {color: green} p {margin-left: 20px} body {background-color:yellow} </style> </head> <body> <h1 style ="color =blue; text-align=center"> BIT05206 </h1> <hr> <p>DHTML tutorial</p> </body> </Html> Tag Modifier Inline
  • 21. CSS (cont.) • How to Insert a Style Sheet – External Style Sheet ideal when the style is applied to many pages .css text file <head> <link rel="stylesheet" type="text/css“ href="mystyle.css" /> </head>
  • 23. CSS • Click for more details: CSS Tutorial.
  • 25. JavaScript Introduction • JavaScript was designed to add interactivity to HTML pages • JavaScript is a scripting language (a scripting language is a lightweight programming language) • JavaScript embedded in a web browser connects through interfaces called Document Object Models (DOMs) to applications server-side and client-side. This allows interactivity and dynamicity.
  • 26. JavaScript Introduction • A JavaScript is usually embedded directly into HTML pages • JavaScript is an interpreted language (means that scripts execute without preliminary compilation)
  • 27. How to Put a JavaScript Into an HTML Page • Scripts in the body section: – Scripts to be executed when the page loads go in the body section.. <html> <body> <script type="text/javascript"> document.write("Hello World!") </script> </body> </html>
  • 28. Java Script • Scripts in the head section: – Scripts to be executed when they are called, or when an event is triggered, go in the head section. <html> <head> <script type="text/javascript"> …….. </script> </head> </html>
  • 29. Java Script • External JavaScript – Save the external JavaScript file with a .js file extension <script src="xxx.js"> </script> • Deals with web elements using Java command, – If statement – Variables – Loops – …….
  • 30. JavaScript Examples <Html> <body> <script type="text/javascript"> var d=new Date() var timeh=d.getHours() var timem=d.getMinutes() document.bgColor=“red” document.write("the time is: ") document.write(timeh) document.write(":") document.write(timem) if (timeh>=12) document.write(" PM") else document.write(" AM") </script> </body>
  • 31. JavaScript – function <html> <head> <script type="text/javascript"> function message() { alert("Welcome guest!") } </script> </head> <body> <input type="button" value="View message" onclick="message()" /> </body> </html>
  • 32. Java Script and DOM <html> <body> <h1 id="header">My header</h1> <script type="text/javascript"> document.getElementById('header').style.color="red" </script> <p><b>Note:</b> It is the script that changes the style of the element!</p> </body> </html>
  • 33. More About DOM http://www.w3schools.com/htmldom/default.asp
  • 34. Example Try it <html> <head> <script type="text/javascript"> function hide() { document.getElementById('txt1').style.visibility ='hidden' } function show() { document.getElementById('txt1').style.visibility = 'visible' } function format() { document.getElementById('txt1').style.color = 'red' document.getElementById('txt1').style.fontSize = '20' document.getElementById('txt1').style.textAlign ="center" document.bgColor='green' }
  • 35. Example (Cont) function reset() { document.getElementById('txt1').style.color = 'black' document.getElementById('txt1').style.fontSize = '14' document.getElementById('txt1').style.visibility = 'visible' document.bgColor='white' document.getElementById('txt1').style.textAlign ="left" } </script </head> <body> <input type="text" id= "txt1"> <input type="button" value="Hide" onclick="hide()"> <input type="button" value="show" onclick="show()"> <input type="button" value="format" onclick="format()"> <input type="button" value="Reset" onclick="reset()"> </body> </html>
  • 36. Next: go through all the examples and try them