m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/html.md
blob: f43659f7bea6930c05cbd6b122012690db9d9c9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# HTML stuff

## DOM manipulation

    // create new element
    document.createElement('button')
    
    // append child
    element1.appendChild(element2)
    
## Elements

### Button

By default, a button has type `reset` or `submit`, both of which reload the
page. To avoid reloading:

    <button type='button'></button>

### Checkbox

To check by default:

    <input type='checkbox' checked>

## CLI parsing with `pup`

`pup` is a little command line parser, inspired by `jq`.

    pup --file <file> '<selectors> [display function]'

By default pretty prints the full selected HTML elements. Setting display
function to `text{}` prints out just the inner text.