<commit_before>[![npm](https://img.shields.io/npm/v/nativescript-dom.svg)](https://www.npmjs.com/package/nativescript-dom)
[![npm](https://img.shields.io/npm/l/nativescript-dom.svg)](https://www.npmjs.com/package/nativescript-dom)
[![npm](https://img.shields.io/npm/dt/nativescript-dom.svg?label=npm%20d%2fls)](https://www.npmjs.com/package/nativescript-dom)

# NativeScript-DOM
A class of DOM based NativeScript functions


## License
This is released under the MIT License, meaning you are free to include this in any type of program -- However for entities that need a support contract, changes, enhancements and/or a commercial license please contact me at [http://nativescript.tools](http://nativescript.tools).

I also do contract work; so if you have a module you want built for NativeScript (or any other software projects) feel free to contact me [<EMAIL>](mailto://<EMAIL>).

[![Donate](https://img.shields.io/badge/Donate-PayPal-brightgreen.svg?style=plastic)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=HN8DDMWVGBNQL&lc=US&item_name=Nathanael%20Anderson&item_number=nativescript%2ddom&no_note=1&no_shipping=1&currency_code=USD&bn=PP%2dDonationsBF%3ax%3aNonHosted)
[![Patreon](https://img.shields.io/badge/Pledge-Patreon-brightgreen.svg?style=plastic)](https://www.patreon.com/NathanaelA)

## Updates
Please feel free to fork this repo and update the functions or add additional DOM based functions!

## Installation 
For NativeScript 3.0 and later type

```bash
tns plugin add nativescript-dom  
```

To use in Nativescript 2.5 or earlier type:

```bash
tns plugin add nativescript-dom@1.1.0`
```

## Usage
To use the  module you just `require()` it:

```js
require("nativescript-dom");
```

**Note:** You do NOT need to keep a reference to it; and you only need to load it once.
It will automatically attach its methods to all the proper classes in the NativeScript library, making it act as if they are built in.

### Methods

#### `getElementById(id)`
#### `getElementsByClassName(className)`
#### `getElementsByTagName(tagName)`

These are globally available! Like their Web DOM counterparts; they return elements based on the critera.

#### `view.getElementById(id)`
#### `view.getElementsByClassName(className)`
#### `view.getElementsByTagName(tagName)`
Like their Web DOM counterparts; returns the children elements based on the critera.<commit_msg>Fix a typo in README<commit_after>[![npm](https://img.shields.io/npm/v/nativescript-dom.svg)](https://www.npmjs.com/package/nativescript-dom)
[![npm](https://img.shields.io/npm/l/nativescript-dom.svg)](https://www.npmjs.com/package/nativescript-dom)
[![npm](https://img.shields.io/npm/dt/nativescript-dom.svg?label=npm%20d%2fls)](https://www.npmjs.com/package/nativescript-dom)

# NativeScript-DOM
A class of DOM based NativeScript functions


## License
This is released under the MIT License, meaning you are free to include this in any type of program -- However for entities that need a support contract, changes, enhancements and/or a commercial license please contact me at [http://nativescript.tools](http://nativescript.tools).

I also do contract work; so if you have a module you want built for NativeScript (or any other software projects) feel free to contact me [<EMAIL>](mailto://<EMAIL>).

[![Donate](https://img.shields.io/badge/Donate-PayPal-brightgreen.svg?style=plastic)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=HN8DDMWVGBNQL&lc=US&item_name=Nathanael%20Anderson&item_number=nativescript%2ddom&no_note=1&no_shipping=1&currency_code=USD&bn=PP%2dDonationsBF%3ax%3aNonHosted)
[![Patreon](https://img.shields.io/badge/Pledge-Patreon-brightgreen.svg?style=plastic)](https://www.patreon.com/NathanaelA)

## Updates
Please feel free to fork this repo and update the functions or add additional DOM based functions!

## Installation 
For NativeScript 3.0 and later type

```bash
tns plugin add nativescript-dom  
```

To use in Nativescript 2.5 or earlier type:

```bash
tns plugin add nativescript-dom@1.1.0
```

## Usage
To use the  module you just `require()` it:

```js
require("nativescript-dom");
```

**Note:** You do NOT need to keep a reference to it; and you only need to load it once.
It will automatically attach its methods to all the proper classes in the NativeScript library, making it act as if they are built in.

### Methods

#### `getElementById(id)`
#### `getElementsByClassName(className)`
#### `getElementsByTagName(tagName)`

These are globally available! Like their Web DOM counterparts; they return elements based on the critera.

#### `view.getElementById(id)`
#### `view.getElementsByClassName(className)`
#### `view.getElementsByTagName(tagName)`
Like their Web DOM counterparts; returns the children elements based on the critera.
{'fraction_non_alphanumeric': 0.13284518828451883, 'fraction_numerical': 0.007949790794979079, 'mean_word_length': 5.7054698457223, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 20, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1804909', 'n_tokens_mistral': 1607, 'n_tokens_neox': 1488, 'n_words': 427}