摘要:
1.页面中获取对象 document.getElementById("demo") 2.在页面加载时向 HTML 的 <body> 写文本 document.write("<h1>This is a heading</h1>"); 如果在文档已完成加载后执行 document.write,整个 HT 阅读全文
posted @ 2018-03-05 19:27
songjn
阅读(173)
评论(0)
推荐(0)
摘要:
1.类型转换①转换成字符串toString() ⅰBoolean 值、数字和字符串的原始值的有趣之处在于它们是伪对象,这意味着它们实际上具有属性和方法。 var sColor = "red";alert(sColor.length); //输出 "3" ⅱ3 种主要的原始类型 Boolean 值、数 阅读全文
posted @ 2018-03-05 19:26
songjn
阅读(125)
评论(0)
推荐(0)
摘要:
1.jQuery 的 hide() 函数,隐藏了 HTML 文档中所有的 <p> 元素。<script type="text/javascript">$(document).ready(function(){ $("p").click(function(){ $(this).hide(); });} 阅读全文
posted @ 2018-03-05 19:25
songjn
阅读(122)
评论(0)
推荐(0)