摘要:
自定义属性的出现并非始于HTML5,但HTML5将 data-* 真正合法化。data自定义属性如何操作?有何用途?。首先给定一段html代码:This is a div elem! This is a div elem,too! 注意:1. 自定义属性用来存储或操作数据,可读可写,但不会在页面显示;2. 属性值可以是普通的字符串(“string”),也可以以json格式或数组来存储;$("body").data("foo", 52); $("body").data("bar", { myType: "t 阅读全文
摘要:
1.信息输出 Console.log,不仅可以向控制台输出信息,而且能接受多个参数并支持按照指定格式输出内容。var animal = "cat", count = 30;console.log("The mount of %s are %d", animal,count);orconsole.info("The mount of %s are %d", animal,count);也可混合字符替代和字符链接使用。var name = "Terry", thing1 = "book", thin 阅读全文