Web 1.0 was the era of static HTML websites, which primarily comprised of plain text, images, and hyperlinks. JavaScript wasn't initially intended for web development in the early days, but gradually it became popular for adding some basic interactivity to web pages.
Here's an example of how to create a simple web page in Web 1.0 using JavaScript:
452 chars19 lines
In this example, we use HTML to define the basic structure of the web page, such as the page title, headings, paragraphs, and a button. The onclick
attribute of the button is set to a JavaScript function that displays an alert dialog box when clicked.
The <script>
tag is used to embed JavaScript code into the HTML page. In this example, we define a function changeText()
that selects the first <p>
element on the page using document.querySelector()
and changes its content using .textContent
.
This is a very basic example of how JavaScript can be used in Web 1.0 development. However, as web development progressed, JavaScript became much more powerful and evolved into a key technology for building interactive and dynamic web applications.
gistlibby LogSnag