JavaScript Reference/Javascript Methods/duplicate

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

"duplicate()" Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
    var myText = myButton.createTextRange();
    alert(myText.duplicate().text); 
} 
</script>
<button id="myButton" onclick="function1();">Click this button</button>
</body>
</html>



"duplicate()" is applied to

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



"duplicate()" Syntax, Parameters and Note

Note:
Creates a duplicate of the specified TextRange object.
    
Syntax:
    
textRangeName.duplicate()