我可以在浏览器地址栏上获得#value吗?

时间:2012-07-30 07:19:08

标签: javascript jquery html

  

可能重复:
  Find the “#” character in a string with Javascript
  How do I get the value after hash (#) from a URL using jquery

我可以在浏览器地址栏中获得#value吗?
例如,来自网址:http://test.com/#div1
我可以使用javascript从该网址获取div1吗?

1 个答案:

答案 0 :(得分:2)

您可以使用window.location.hash

相关问题