2、打开一页面后,点击一按钮,将当前网页加入到IE的收藏夹里。
<input type="button" name="as" onclick="book()">
function book(){
window.external.AddFavorite(location.href, document.title)
}

解决方案 »

  1.   

    1.
    <input type="text" id="ice"/>
    <input type="button" value="Copy" onclick="clipboardData.setData('Text',document.getElementById('ice').value)"/>
    <input type="button" value="show" onclick="alert(clipboardData.getData('text'))"/>
      

  2.   

    1.
    <input type="text" id="ice"/>
    <input type="button" value="Copy" onclick="clipboardData.setData('Text',document.getElementById('ice').value)"/>
    <input type="button" value="show" onclick="alert(clipboardData.getData('text'))"/>
      

  3.   

    一个文本框时有内容,点击一按钮,将文本框的内容复制到剪贴板上<form name="test">
    <a class="highlighttext" href="javascript:HighlightAll('test.select1')">Select All</a><br>
    <textarea name="select1" rows=10 cols=35 >This is some text. This is some text. This is some text. This is some text.</textarea>
    </form><style>
    .highlighttext{
    background-color:yellow;
    font-weight:bold;
    }
    </style><script language="Javascript">
    <!--/*
    Highlight and Copy form element script- By Dynamicdrive.com
    For full source, Terms of service, and 100s DTHML scripts
    Visit http://www.dynamicdrive.com
    *///specify whether contents should be auto copied to clipboard (memory)
    //Applies only to IE 4+
    //0=no, 1=yes
    var copytoclip=1function HighlightAll(theField) {
    var tempval=eval("document."+theField)
    tempval.focus()
    tempval.select()
    if (document.all&&copytoclip==1){
    therange=tempval.createTextRange()
    therange.execCommand("Copy")
    window.status="Contents highlighted and copied to clipboard!"
    setTimeout("window.status=''",1800)
    }
    }
    //-->
    </script>