Location.hash
In this chapter you will learn:
Hash of location
The hash
property can be set with new values that alter the current URL.
Assume starting at http://www.java2s.com/index.htm
location.hash = "#section1";
changes URL to "http://www.java2s.com/index.htm#section1"
<!DOCTYPE HTML> // ja v a2s . c o m
<html>
<body>
<script>
document.location.hash = "section";
</script>
</body>
</html>
Next chapter...
What you will learn in the next chapter: