765427457

导航

2019年10月18日 #

原生js-----------addEventListener添加事件和直接添加事件区别

摘要: 1. a. document.querySelector("#a").onclick=function() {console.log("11111")} b. document.querySelector("#a").onclick=function(){console.log("222")} 结果 阅读全文

posted @ 2019-10-18 19:49 765427457 阅读(390) 评论(0) 推荐(0)

jquery $()括号里什么情况加"",什么情况不加

摘要: 一、如果是已经声明存在的变量或者对象,就不用加引号。 比如var name=document.getElementById("name"); $(name)或者$(this)。 二、document、this、window 这些都是系统对象 可以直接使用, 所以不用加引号。 三、加引号的一般是元素标 阅读全文

posted @ 2019-10-18 19:25 765427457 阅读(410) 评论(0) 推荐(0)