MCPcopy Index your code
hub / github.com/prototypejs/prototype / getSelection

Function getSelection

test/unit/tests/form.test.js:180–191  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

178
179 test('activating forms', function () {
180 function getSelection (element) {
181 try {
182 if (typeof element.selectionStart === 'number') {
183 return element.value.substring(element.selectionStart,
184 element.selectionEnd);
185 } else if (document.selection && document.selection.createRange) {
186 return document.selection.createRange().text;
187 }
188 } catch (e) {
189 return null;
190 }
191 }
192
193 var element = Form.findFirstElement('form-test-bigform');
194 assert.equal('submit', element.id,

Callers 1

form.test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected