Lecture Web technologies and programming – Lecture 19: Working with Background and Images - TRƯỜNG CÁN BỘ QUẢN LÝ GIÁO DỤC THÀNH PHỐ HỒ CHÍ MINH

10 9 0
Lecture Web technologies and programming – Lecture 19: Working with Background and Images - TRƯỜNG CÁN BỘ QUẢN LÝ GIÁO DỤC THÀNH PHỐ HỒ CHÍ MINH

Đang tải... (xem toàn văn)

Thông tin tài liệu

User Inputs bgcolor in Prompt Box. After Applying bgcolor[r]

(1)(2)(3)

Dialog boxes in JavaScriptAlert box

Prompt boxConfirm boxWhat is DOM? HTML DOM

Retrieving HTML elementsgetElementById()

innerHTMLgetAttribute()setAttribute()

(4)

HTML DOM Elements

Finding HTML Elements

Find an element by elementFind elements by tag

Find elements by class name

(5)

Controlling the background

dynamically

Working with imagesDate Object

(6)

The body tag has the following attributes

Bgcolor

It is Background Color

Background

It deals with the Background Image

Text

It is the text user sees in the browser

(7)

We can access the bgcolor by

following methods:

document.body.bgColor

document.getElementById(“id of the body

tag”).bgColor

(8)

Starting Function User Input

Setting bgcolor

Calling Function

(9)

User Inputs bgcolor in Prompt Box

After Applying bgcolor

(10)

Set a background color for a

document:

We can access the body text by

following methods:

document.body.style.color

document.getElementById(“id of the body

tag”).style.color

Ngày đăng: 01/04/2021, 02:16

Tài liệu cùng người dùng

Tài liệu liên quan