1 允许字母、数字、$、下划线
分享一个有趣的函数:
function $(id) {
return document.getElementById(id);
}
这样就做成了jquery查找id节点的一个模板,直接调用即可,是不是很有趣?
如果再这样:

是不是就更加熟悉了??
function $(id) {
return document.getElementById(id);
}
这样就做成了jquery查找id节点的一个模板,直接调用即可,是不是很有趣?
如果再这样:
是不是就更加熟悉了??
本文标题:js函数命名规则
本文链接:https://www.haomeiwen.com/subject/jlmioftx.html
网友评论