## HTML <script> src Attribute
The `src` attribute of the `
```
---
## Browser Support
The `src` attribute is universally supported across all major modern web browsers:
* Google Chrome
* Mozilla Firefox
* Microsoft Edge / Internet Explorer
* Safari
* Opera
---
## Syntax
```html
```
### Attribute Values
| Value | Description |
| :--- | :--- |
| **`URL`** | The URL of the external script file.
**Possible values:**
β’ **Absolute URL:** Points to another website (e.g., `src="https://www.example.com/js/app.js"`).
β’ **Relative URL:** Points to a file within the same website (e.g., `src="/scripts/app.js"` or `src="app.js"`). |
---
## Detailed Usage & Best Practices
### 1. External vs. Inline Scripts
When using the `src` attribute to load an external script, the `
```
**Correct:**
```html
```
### 2. No `
```
**Correct (`myscripts.js`):**
```javascript
alert("Hello World!");
```
### 3. Improving Performance with `async` and `defer`
When loading external scripts using the `src` attribute, you can control how the script is downloaded and executed relative to the HTML parsing using the `async` or `defer` boolean attributes:
* **Normal (`
YouTip