1.返回顶部(完全兼容各个浏览器,不含美化) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset
/* mightygumball.js */ /* * get the content of a JSON file using JSONP * update every 3 seconds. * */ var lastReportTime = 0; window.onload = init; function init() { var interval = setInterval(handleRefresh, 3000); handleRefresh(); } function handleR
<script type="text/javascript"> var tags = document.getElementsByTagName('*'); var tagsArr = []; function countTag(){ for (var i = 0; i < tags.length; i++) { tagsArr.push((tags[i].tagName).toLowerCase()); } var temp = []; //该数组用于存放相同的元素
Even a task as simple as this can be complicated without jQuery at our disposal. In plain JavaScript, we could add the highlightedclass as shown in the following code snippet: window.onload = function() { var divs = document.getElementsByTagName('div