Use javascript to dynamically comment out HTML code

Source: Internet
Author: User

<Html> <pead> <title> use javascript to dynamically comment out HTML code-51windows. net </title> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "> </pead> <body> <table border =" 1 "width =" 100% "> <tr> <td width =" 50% "> 1 </td> <td width = "50%"> 2 </td> </tr> <td width = "50%"> 3 </td> <td width = "50% "> 4 </td> </tr> <td width =" 50% "> 5 </td> <td width =" 50% "> 6 </td> </tr> <td width = "50%"> 7 </td> <td width = "50%"> 8 </Td> </tr> </table> <p> you didn't see 34 cells, because he commented out in javascript. How did he do it? View Source file! What are the source files? Right-click and select "View Source file (V )"... </p> <p style = "color: red;"> Note: html comments cannot be added to dynamic comments. "<! --> ", <Script> and </script> are not allowed." <! -- "And" // --> "</p> <p> in addition to this method, you can also use document. getElementById ("xx "). style = "none"; this method dynamically displays or hides a region </p> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Related Article

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.