Lecture Web technologies and programming – Lecture 19: Working with Background and Images

After studying this chapter you will be able to understand: Dialog boxes in JavaScript, HTML DOM, retrieving HTML elements, setting HTML elements, controlling the background dynamically, working with images, date object. | 1 CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr. Tehseen Riaz Abbasi 1 2 Dialog boxes in JavaScript Alert box Prompt box Confirm box What is DOM? HTML DOM Retrieving HTML elements getElementById() innerHTML getAttribute() setAttribute() 3 HTML DOM Elements Finding HTML Elements Find an element by element Find elements by tag Find elements by class name 4 Controlling the background dynamically Working with images Date Object 5 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 6 We can access the bgcolor by following methods: (“id of the body tag”).bgColor 7 Starting Function User Input Setting bgcolor Calling Function 8 User Inputs bgcolor in Prompt Box After Applying bgcolor 9 Set a background color for a document: We can access the body text by following methods: (“id of the body tag”). 10 Example Set a background color of a specific element: ("myDiv"). = "lightblue"; 11 Example Return the background color of a specific element: alert(("myDiv").); Example Return the background color of a document: alert(); 12 Set Text Function Setting Color Calling Function Passing Color as Parameter 13 Before Clicking on Text After Clicking on Text for Red Color 14 The background property sets or returns up to eight separate background properties, in a shorthand form. With this property, you can set/return one or more of the following (in any order): background-color background-image background-repeat background-attachment background-position background-size background-origin background-clip 15 Example Set a background color for a document: = "red"; Example Set a background image for a . | 1 CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr. Tehseen Riaz Abbasi 1 2 Dialog boxes in JavaScript Alert box Prompt box Confirm box What is DOM? HTML DOM Retrieving HTML elements getElementById() innerHTML getAttribute() setAttribute() 3 HTML DOM Elements Finding HTML Elements Find an element by element Find elements by tag Find elements by class name 4 Controlling the background dynamically Working with images Date Object 5 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 6 We can access the bgcolor by following methods: (“id of the body tag”).bgColor 7 Starting Function User Input Setting bgcolor Calling Function 8 User Inputs bgcolor in Prompt Box After Applying bgcolor 9 Set a background color for a document: We can access the body text by following methods: (“id of .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.