怎样遍历页面中的元素?

怎样遍历页面中每一个的元素,因为我编写一个函数,当打印时自动将不打印的部分元素隐藏。
---------------------------------------------------------------

1<style>   
2@media print {.ptn {display:block;}.notptn {display:none;}.onlyPrint{page-break-before:always}}   
3</style>
1<input type="button" value="打印"/>
1<input class="notptn" type="button" value="不打印"/>
Published At
Categories with Web编程
comments powered by Disqus