JavaScript Reference/Javascript Methods/moveEnd

Материал из Web эксперт
Перейти к: навигация, поиск

"moveEnd()" Example

    
<html>
<body>
<script language="JavaScript">
var range;
function function1() {
    range = myText.createTextRange();
    var m = range.moveEnd("textedit");
    range.select(); 
} 
</script>
<input id="myText" type="text" value="Some sample text. This text is editable" 
size="50">
<input type="button" value="Select the text inside the textbox" onclick="function1();">
</body>
</html>



"moveEnd()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |TextRange                                                     |
+----------------+--------------------------------------------------------------+



"moveEnd()" Syntax, Parameters and Note

Note:
Moves the end position of a text to a new location and 
returns the number of units moved.
    
Syntax:
    
textRangeName.moveEnd(param1, param2)
Parameters:
    param1   Required; the type of units to move. 
                       character, 
                       word, 
                       sentence, 
                       textedit             start or end of the text range
    param2   Optional; the number of units to move.