JavaScript Reference/Javascript Methods/pasteHTML

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

"pasteHTML()" Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
    var myRange = document.selection.createRange();
    var m = myRange.pasteHTML("<p>www.wbex.ru</p>"); 
} 
</script>
<p>Highlight a part of this text, then click button below</p>
<input id="myB" type="button" value="Click me" onclick="function1();">
</body>
</html>



"pasteHTML()" is applied to

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



"pasteHTML()" Syntax, Parameters and Note

Note:
Paste HTML.
    
Syntax:
    
textRangeName.pasteHTML(param1)
Parameters:
    param1   Required; the HTML text to paste.