<!-- 简单实现用链接模枋按钮,并给边线加上圆弧 -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> 链接按钮 </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<style>
a {
background: #eeeeee;
border: 1px solid #bbb;
/* 圆弧边线,数值越大,弧度越大,低版本IE应该是不支持 */
border-radius: 10px;
padding-left: 10px;
padding-right: 10px;
text-decoration: none;
/* 移动到按钮上时,鼠标显示为手形(如果a标签不加href,在鼠标移动上去时,不会显示手形) */
cursor: pointer;
}
</style>
</head>
<body>
<a>按钮</a>
<span></span>
<script type="text/javascript">
// 2015/9/10
// 统计字符串中的.个数
// 简单写一个,用来测试链接的点击事件
var test = function() {
var str = ".11.234.\\//\'\".\".";
var c = 0;
for (var i = 0; i < str.length; i++)
{
if (str.substring(i, i + 1) === '.')
{
c++;
}
}
// document.write(c);
document.getElementsByTagName("span")[0].innerHTML = c;
}
document.getElementsByTagName("a")[0].onclick = test;
</script>
</body>
</html>