document.getElementsByClassName();获取一个集合,而不是一个对象

215 阅读1分钟

1 $("#src-to-top");

2 document.getElementsByClassName();\

示例:

var istt=$("#src-to-top");
istt[0].οnclick=function(){
$(window).scrollTop(0);
}\