Copy all links, select all, reverse Select

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.