anchor jumping by using javascript

You can get the coordinate of the target element and set the scroll position to it. But this is so complicated. Here is a lazier way to do that: This uses replaceState to manipulate the url. If you also want support for IE, then you will have to do it the complicated way: Demo: http://jsfiddle.net/DerekL/rEpPA/Another … Read more

link not working

I am trying to create a set of links to specific sections in the page using the <a href=”#…”> notation, but it doesn’t seem to work. Clicking on the link seems to do nothing and right-click -> open in a new tab changes the url but does not move to a different section of the … Read more

href=”tel:” and mobile numbers

When dialing a number within the country you are in, you still need to dial the national trunk number before the rest of the number. For example, in Australia one would dial: For a mobile phone this becomes Now, when I want to dial via the international trunk, you need to drop the trunk prefix and replace … Read more

JavaScript function in href vs. onclick

Putting the onclick within the href would offend those who believe strongly in separation of content from behavior/action. The argument is that your html content should remain focused solely on content, not on presentation or behavior. The typical path these days is to use a javascript library (eg. jquery) and create an event handler using … Read more

Open link in new tab or window [duplicate]

You should add the target=”_blank” and rel=”noopener noreferrer” in the anchor tag. For example: Adding rel=”noopener noreferrer” is not mandatory, but it’s a recommended security measure. More information can be found in the links below. Source: MDN | HTML element <a> | attribute target About rel=noopener Opens External Anchors Using rel=”noopener”