Answers for "jquery copy table to clipboard"

0

jquery copy table to clipboard

function selectElementContents(el) {
	var body = document.body, range, sel;
	if (document.createRange && window.getSelection) {
		range = document.createRange();
		sel = window.getSelection();
		sel.removeAllRanges();
		try {
			range.selectNodeContents(el);
			sel.addRange(range);
		} catch (e) {
			range.selectNode(el);
			sel.addRange(range);
		}
	} else if (body.createTextRange) {
		range = body.createTextRange();
		range.moveToElementText(el);
		range.select();
	}
}
Posted by: Guest on May-28-2021
1

jquery copy to clipboard

document.execCommand("copy");
Posted by: Guest on April-05-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language