* Set an element's text contents. * * @param {HTMLElement} el * @param {string} contents
(el, contents)
| 2840 | * @param {string} contents |
| 2841 | */ |
| 2842 | function text(el, contents) { |
| 2843 | if (el.textContent) { |
| 2844 | el.textContent = contents; |
| 2845 | } else { |
| 2846 | el.innerText = contents; |
| 2847 | } |
| 2848 | } |
| 2849 | |
| 2850 | /** |
| 2851 | * Listen on `event` with callback `fn`. |