UNPKG

text-content

Version:

A cross-browser function for getting and setting the text value of a DOM element.

12 lines (9 loc) 212 B
module.exports = function(node, value) { var text = (node.textContent !== undefined ? 'textContent' : 'innerText' ) if (typeof value != 'undefined') { node[text] = value } return node[text] }