Skip to content

Commit

Permalink
Create a tips file (#5)
Browse files Browse the repository at this point in the history
Maybe this is useful regarding setting SELECT value.
  • Loading branch information
MikeiLL authored May 20, 2024
1 parent 61b7999 commit 3d1297e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tips.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Tips for Chocholate Factory and Lindt

## Quirky DOM elements

### SELECT

When a `<select>` element has a `value` attribute, if one of the `<option>`s matches that value, it
will display as selected. Due to browser quirks, this value must be set _after_ options
have been added. Since `set_content` returns its target element, the value can be set
afterward by chaining:

```
set_content(DOM("#selectelem"), [OPTION(...), OPTION(...)]).value = some_val;
```

0 comments on commit 3d1297e

Please sign in to comment.