mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2024-12-23 10:40:22 +00:00
14 lines
456 B
JavaScript
14 lines
456 B
JavaScript
$.fn.selectRange = function(start, end) {
|
|
return this.each(function() {
|
|
if (this.setSelectionRange) {
|
|
this.focus();
|
|
this.setSelectionRange(start, end);
|
|
} else if (this.createTextRange) {
|
|
var range = this.createTextRange();
|
|
range.collapse(true);
|
|
range.moveEnd('character', end);
|
|
range.moveStart('character', start);
|
|
range.select();
|
|
}
|
|
});
|
|
};
|