Teaching Home HTML Introduction HTMLtags HTMLdoc Element Tree HTML Element Attributes CSS Introduction CSS Basics JavaScript Introduction JavaScript Basics Python Introduction Python Basics Pesky Pixie Home (separate website)

JavaScript Introduction

What is JavaScript? What can it do?

JavaScript is a scripting or programming language that allows you to implement complex features on web pages — every time a web page does more than just sit there and display static information for you to look at — displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video jukeboxes, etc. — you can bet that JavaScript is probably involved. It is the third layer of the layer cake of standard web technologies, two of which (HTML and CSS) are also covered on this wesite.

JavaScript Can Change HTML Content

JavaScript can change HTML content.


JavaScript Can Change HTML Attribute Values

In this case JavaScript changes the value of the src (source) attribute of an image.


JavaScript Can Change HTML Styles (CSS)

Changing the style of an HTML element, is a variant of changing an HTML attribute:


JavaScript can change the style of an HTML element.


JavaScript Can Hide and Show HTML Elements

Hiding/showing HTML elements can be done by changing the display style:

JavaScript can hide and show HTML elements.