1<! DOCTYPE html>2"http://www.w3.org/1999/xhtml">34<meta http-equiv="Content-type"Content="text/html; Charset=utf-8"/>5<title> Copy all links </title>6<script type="Text/javascript">7onload =function () {8 varValues ="";9 //Here you can use name to get all the tagsTen varCK = Document.getelementsbyname ("name"); One //this is used to store the link address in the array, or it can be stored with the string + =, but the array is flexible A vararr = []; -Btncopy.onclick =function () { - for(vari =0; i < ck.length; i++) { the if(Ck[i].checked==true) { - Arr.push (ck[i].nextsibling.href); - } - //using the Clipboard, ARR cannot be used directly, with the Join method, or the ToString method +Clipboarddata.setdata ("text", Arr.join ("\ r \ n")); - //clipboarddata.setdata ("text", arr.tostring ()); + //text.value = arr; A } at } - //Select All -Btnall.onclick =function () { - for(vari =0; i < ck.length; i++) { -Ck[i].checked=true; - } in } - to //Inverse Selection +Btnexcept.onclick =function () { - for(vari =0; i < ck.length; i++) { theCk[i].checked=!ck[i].checked; * } $ }Panax Notoginseng } - the</script> + A<body> the<!--input tag and a tag are placed on the same line, otherwise the DOM fetch node gets to the empty node-- +<input type="checkbox"Name="name"Value=""/><a href="http://www.baidu.com"> Gourd Baby </a><br/> -<input type="checkbox"Name="name"Value=""/><a href="http://www.jd.com"> Gourd Baby </a><br/> $<input type="checkbox"Name="name"Value=""/><a href="http://www.taobao.com"> Gourd Baby </a><br/> $<input type="checkbox"Name="name"Value=""/><a href="http://www.qq.com"> Gourd Baby </a><br/> -<input type="Button"Name=""Value="Select All"Id="Btnall"/> -<input type="Button"Name=""Value="Inverse Selection"Id="btnexcept"/> the<input type="Button"Name=""Value="Copy Link"Id="btncopy"/><br/> -<textarea style="width:300px;height:200px;"Id="text"></textarea>Wuyi the</body> -Copy all links, select all, reverse Select