update to v2.1.0
add support for querySeletor add toHTMLElement clean up comments fix bug in README
This commit is contained in:
33
README.md
33
README.md
@@ -61,7 +61,7 @@ All assume that `$d` is the default function from `fluent-dom-esm` (`import $d f
|
||||
### Create a Paragraph
|
||||
|
||||
```
|
||||
$(document.body).app($d
|
||||
$d(document.body).app($d
|
||||
.c("p")
|
||||
.s("background-color", "yellow")
|
||||
.s("color", "black")
|
||||
@@ -99,7 +99,7 @@ const $ul = $d
|
||||
);
|
||||
});
|
||||
|
||||
$(document.body).app($ul);
|
||||
$d(document.body).app($ul);
|
||||
```
|
||||
|
||||
renders (with added spaces) as
|
||||
@@ -114,6 +114,32 @@ renders (with added spaces) as
|
||||
</body>
|
||||
```
|
||||
|
||||
### Access via QuerySelector
|
||||
|
||||
Given the [example list above](#create-a-list):
|
||||
|
||||
```
|
||||
$d('#example-list')
|
||||
.app($d
|
||||
.c("li")
|
||||
.id(`fluentDom-example-list-item4`)
|
||||
.t("List Item 4")
|
||||
);
|
||||
```
|
||||
|
||||
renders (with added spaces) as
|
||||
|
||||
```
|
||||
<body>
|
||||
<ul class="example-list" id="example-list">
|
||||
<li id="fluentDom-example-list-item1">List Item 1</li>
|
||||
<li id="fluentDom-example-list-item2">List Item 2</li>
|
||||
<li id="fluentDom-example-list-item3">List Item 3</li>
|
||||
<li id="fluentDom-example-list-item4">List Item 4</li>
|
||||
</ul>
|
||||
</body>
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2025 Eric Woodward
|
||||
@@ -123,8 +149,7 @@ Based on [original source](https://glacius.tmont.com/articles/fluent-dom-manipul
|
||||
```
|
||||
This program is free software. It comes without any warranty, to the
|
||||
extent permitted by applicable law. You can redistribute it and/or
|
||||
modify it under the terms of the Do What The Fuck You Want To Public
|
||||
License, Version 2, as published by Sam Hocevar.
|
||||
modify it under the terms of the following license:
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
Reference in New Issue
Block a user