JS获得图片alt信息的方法

时间:2015-04-01    点击:145   

本文实例讲述了JS获得图片alt信息的方法。分享给大家供大家参考。具体如下:

下面的JS代码可通过图片的alt属性获得图片的提示信息

<!DOCTYPE html>
<html>
<body>
<img id="compman" src="compman.gif" alt="Crazy computerman" 
width="107" height="98">
<p>The value of the alt atrribute is:
<script>
document.write(document.getElementById("compman").alt);
</script>
</p>
</body>
</html>

希望本文所述对大家的javascript程序设计有所帮助。

javascript算法题:求任意一个1-9位不重复的N位数在该组合中的大小排列序号
JS动态修改iframe高度和宽度的方法
JS获取iframe中marginHeight和marginWidth属性的方法
JS去除iframe滚动条的方法
JS动态修改iframe内嵌网页地址的方法
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved