Ответ 1
Да, вы можете. Я делаю что-то подобное на одном из моих сайтов, но с href
вместо id
, но id
тоже работает. Быстрый пример:
$('a[id]').click(function(e)
{
// This will change the URL fragment. The change is reflected
// on your browser address bar as well
window.location.hash = this.id;
e.preventDefault();
});