2,462
社区成员
发帖
与我相关
我的任务
分享
<a style="font-size:12px; color:#0066cc;" href="/Comeon/ueditor1_4_3-utf8-asp/asp/20160505/14624106711489408.xls" title="卡片列表.xls">卡片列表.xls</a>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb-2312"/>
<script language="JavaScript">
function getTitle(){
var tags = document.getElementsByTagName("a");
for (i=0;i<tags.length;i++){
var title = tags[i].getAttribute("title");
if (title != '')
alert(title);
}
}
</script>
</head>
<body>
<a href="http://my.csdn.net/n530956064" rel="nofollow" target="_blank"><img alt="n530956064" class="avatar" src="http://avatar.csdn.net/F/9/0/1_n530956064.jpg" /></a><br>
例如<br>
<a style="font-size:12px; color:#0066cc;" href="/Comeon/ueditor1_4_3-utf8-asp/asp/20160505/14624106711489408.xls" title="卡片列表.xls">卡片列表.xls</a><br>
取到 卡片列表.xls<br>
<input type="button" value="则取 A标签中的title" onclick="getTitle();"/>
</body>
</html>