Elementals.js

Latest Version: 2.0 RC 3 14 March 2017

Method _.nodeSelect

Calling Convention:
_.callbackNodeSelect(Element)
Parameters:
Element
The element you want to select the contents of. This will be performed using either document.body.createTextRange or window.getSelection as appropriate to the browser in use.
Returns:
Nothing

This function is meant for internal use by _.nodeAddSelectButton but is exposed for public access as who knows, somebody migth find it useful.

Example

Code

var sampleCode = document.getElementById('sampleCode');
_.nodeSelect(sampleCode);

The contents of #sampleCode will behave as if you selected them with the mouse.