Split each lines inside an HTMLElement by scoping them inside some tags. Here's an result sample for : Hello World
<p class="split-lines">Hello</p>
<p class="split-lins">World</p>
import __splitLines from 'coffeekraken-sugar/js/dom/splitLines'
const myCoolElement = document.querySelector('.my-cool-element');
__splitLines(myCoolElement);
Name | Type | Description | Status | Default |
---|---|---|---|---|
elm | { HTMLElement } | The HTMLElement to split lines in | required | |
tag | { String } | The tag to use to split the lines | optional | "p" |
tagClass | { String } | The class to apply on the tags | optional | "s-split-lines" |
Return { HTMLElement } The HTMLElement processed
Author : Olivier Bossel [email protected] https://olivierbossel.com