![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
< span href = " http://www.baidu.com/ " > baudu < / span>
< script type = " text/javascript " >
var span = document.getElementsByTagName( " span " )[ 0 ];
var href = span.getAttribute( " href " ); // 获取该元素的href属性值
span.onclick = function (){ // 定义鼠标单击事件处理函数
window.location = href; // 装载URL
}
< / script>