Meteor Anchor Tags
Anchor tags don’t work in Meteor. This is a known issue.
The standard format to use anchor tags is:
# Create a link pointing to the anchor
Click <a href="#intro">here</a> for the introduction.
# Create the anchor itself
<a id=#intro"></a>
But in Meteor this doesn’t work. Instead you need to use Iron Router.
In this example, we want to link WITHIN THE SAME PAGE, in this case called ‘home.’ So our router.js file looks as follows:
# Router.js
Router.route('/', {
name: 'home'
});
And the code we need, to get anchor tags to work in Meteor, is this:
# Create a link pointing to the anchor
Click <a href="{{pathFor 'home' hash='intro'}}">here</a> for the introduction.
# Create the anchor itself
<a id="intro"></a>
Want to improve your JavaScript? I have a list of recommended JavaScript books.