hash 属性是一个可读可写的字符串,该字符串是 URL 的锚部分(从#号开始的部分)。 location.hash=anchorname 转自:http://www.w3school.com.cn/htmldom/prop_loc_hash.asp