# init-with-dom

> init with dom

Latest version **1.2.5** (published 2022-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install init-with-dom
pnpm add init-with-dom
yarn add init-with-dom
bun add init-with-dom
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.5 |
| Published | 2022-08-06 |
| First published | 2017-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | antitim |
| Maintainers | antitim |

## Links

- npm: https://www.npmjs.com/package/init-with-dom
- Repository: https://github.com/antitim/iwd
- Issues: https://github.com/antitim/iwd/issues
- npm.io page: https://npm.io/package/init-with-dom

## Recent versions

- 1.2.5 (latest) — 2022-08-06
- 1.2.4 — 2020-10-31
- 1.2.3 — 2019-09-04
- 1.2.2 — 2017-12-01
- 1.2.1 — 2017-11-25
- 1.2.0 — 2017-11-25
- 1.1.1 — 2017-07-05
- 1.1.0 — 2017-07-05
- 1.0.5 — 2017-06-26
- 1.0.4 — 2017-06-22
- 1.0.3 — 2017-06-21
- 1.0.2 — 2017-06-21
- 1.0.1 — 2017-06-21
- 1.0.0 — 2017-06-21

## README

# IWD (init with DOM) [![NPM version][npm-image]][npm-url]
## About

This script performs the function with the name specified in the attribute of the dom element in the context of this item.

Supported the start of the function even if the DOM Element has been added after initialization of the script (MutationObserver).

## Browser
- IE 10+
- Edge
- Firefox 14+
- Chrome 18+
- Safary 6+
- Opera 15+
- iOS Safari 6.1+
- Android Browser 4.4 +


## Usage

```html
<div data-js="time" data-name="Hi" id="megaId"></div>
<script>
  function time (params) {
    var self = this; // DOM Element <div data-js="time"></div>
    var seconds;

    params; // { data: { name: "Hi" }, class: "js", id: "megaId" }

    setInterval(function () {
      var dt = new Date();

      if (seconds !== dt.getSeconds()) {
        self.innerText = dt.getHours() + ':' + dt.getMinutes() + ':' + dt.getSeconds();
      }
      seconds = dt.getSeconds();
    }, 100)
  }
</script>
<script src="../build/iwd.min.js"></script>
```
## Test
[<img src="https://www.browserstack.com/images/mail/browserstack-logo-footer.png" width="120">](https://www.browserstack.com/)

Thank you to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows to test in real browsers.

[Test](https://antitim.github.io/iwd/test/index.html)

## License

MIT © [antitim](http://vk.com/antitim)


[npm-image]: https://badge.fury.io/js/init-with-dom.svg
[npm-url]: https://npmjs.org/package/init-with-dom

---
_Source: https://npm.io/package/init-with-dom · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
