An open API service indexing awesome lists of open source software.

https://github.com/hootanht/print


https://github.com/hootanht/print

Last synced: 7 months ago
JSON representation

Awesome Lists containing this project

README

          

```markdown
# HTML Document with JavaScript Redirection

## Introduction
This is a simple HTML document with a JavaScript script that redirects the user to another page after a specific timeout.

## HTML Structure
```html



Document



// Set a timeout of 10 seconds (10,000 milliseconds)
setTimeout(function () {
// Redirect to 'page2.html'
window.location.href = 'page2.html';
}, 10000);

```

## Explanation

1. **DOCTYPE and HTML Tag**
- ``: Specifies the HTML version being used.
- ``: Defines the root of the HTML document with the language set to English.

2. **Head Section**
- ``: Contains meta-information about the HTML document.
- ``: Specifies the character encoding.
- ``: Sets the viewport for responsive design.
- `Document`: Sets the title of the document.

3. **Body Section**
- ``: Contains the content of the HTML document.
- ``: Introduces a block of JavaScript code.
- `setTimeout`: Executes a function after a specified timeout.
- The function changes the window location to 'page2.html' after 10 seconds (10,000 milliseconds).

## Usage
1. Copy the HTML code provided.
2. Create a new HTML file in your preferred text editor.
3. Paste the copied code into the file.
4. Save the file with an appropriate name (e.g., `index.html`).
5. Open the file in a web browser.
6. After 10 seconds, the page will automatically redirect to 'page2.html'.
```

Feel free to customize the guide further based on your specific needs or add more details as necessary.