随笔分类 -  javascript

摘要:1.document.write(""); 输出语句2.JS中的注释为//3.传统的HTML文档顺序是:document->html->(head,body)4.一个浏览器窗口中的DOM顺序是:window->(navigator,screen,history,location,document)5.得到表单中元素的名称和值:document.getElementById("表单中元素的ID号").name(或value)6.一个小写转大写的JS: document.getElementById("output"). 阅读全文
posted @ 2012-09-06 22:07 加勒比海盗船 阅读(179) 评论(0) 推荐(0)
摘要:window.print可以打印网页,但有时候我们只希望打印特定控件或内容,怎么办呢?首先我们可以把要打印的内容放在div中,然后用下面的代码进行打印。<html><head><script language="javascript">function printdiv(printpage){var headstr = "<html><head><title></title></head><body>";var footstr = "&l 阅读全文
posted @ 2012-08-31 16:05 加勒比海盗船 阅读(134) 评论(1) 推荐(0)