---
# System prepended metadata

title: Internal Training - D3
tags: [CS]

---

---
title: Internal Training - D3
tags: CS
---

# Internal Training - Interactive D3

## Installation

- Go to [CodeSandbox](https://codesandbox.io/)
- Click Create Sandbox 
    ![](https://i.imgur.com/kQmyzp3.png)
- Choose Static
    ![](https://i.imgur.com/ESw8u4L.png)

- New file `script.js`:

```js
alert("Hello");
```
- Add to `index.html`

```html
<script src="script.js"></script>
...
<h1 id="title">
```

- Change `script.js`

```js
function changeTitle(title) {
  document.querySelector("#title").textContent = title;
}
```

- `script.js`

```js
window.onload = () => {
  changeTitle("Coderschool");
};

function changeTitle(title) {
  document.querySelector("#title").textContent = title;
}
```