How To Link to Specific Text on a Web Page

Sharing links has enabled us to find relevant information more quickly than ever, but it’s challenging to do so with text-rich web pages. Finding useful data requires scanning the whole text, which is tedious and time-consuming. However, using your web browser to create preprogrammed links leading to highlighted text will allow you to share pertinent information with others.

How To Link to Specific Text on a Web Page

This guide will discuss creating a direct scroll-to-text link on several web browsers using a PC or Mac.

Link to Specific Text on a Web Page on a PC

If you’re a PC user, two methods will allow you to create links that take your recipient to a specific phrase or paragraph of a web page. You can either create shareable bookmarks or use an extension for your preferred browser.

Creating Bookmarklets

Bookmarks packed with small portions of JavaScript codes are called bookmarklets. When you click on a specific bookmark link, it will perform a predefined action. If used to take users to specific web page sections, the bookmarklet will open the website and zero in on the highlighted text area. This feature works on Chrome-based browsers like Google Chrome and Microsoft Edge.

Creating a clickable bookmarklet on Google Chrome is a relatively straightforward process. To do so:

  1. Hold down “Ctrl + Shift + B” to enable your browser’s bookmark or favorite tab.
  2. Press “Ctrl + Shift + O” to enter the Chrome “Bookmarks Manager.” Alternatively, select “Settings,” tap “Bookmarks,” and press “Bookmarks Manager.”

  3. Once in the “Bookmarks Manager” section, right-click and choose the “Add new bookmark” option.
  4. Paste the following line of code into the pop-up URL field:
    “javascript:(function(){const selectedText=getSelection().toString();const newUrl=new URL(location);newUrl.hash=`:~:text=${encodeURIComponent(selectedText)}`;window.open(newUrl);})();”
  5. Rename the bookmarklet. Use the name “Share with Friend” or a similar variation and tap the “Save” button.

When you’ve created your bookmarklet, you can use it to go directly to a specific part of a website. Here’s how it works:

  1. Launch a web page, select a part of its text using the cursor, and tap the “Share with Friend” bookmarklet.
  2. The action will generate a new window, and the selected text will be highlighted in yellow.
  3. Copy the link.

Once someone clicks on this customized link, the web page will automatically scroll to the section of highlighted text. Only users using Google Chrome or Microsoft Edge browser will be able to click on your link.

It’s also possible to make bookmarklets in the latest Microsoft Edge version. To do so:

  1. Hold “Ctrl + Shift + O” to go to the “Manage favorites” tab. Alternatively, open the “Edge menu,” select “Favorites,” and tap “Manage favorites.”
  2. Navigate to the “Favorites” section and right-click.
  3. Choose “Add favorite.”
  4. Enter the following JavaScript excerpt in the pop-up URL field:
     “javascript:(function(){const selectedText=getSelection().toString();const newUrl=new URL(location);newUrl.hash=`:~:text=${encodeURIComponent(selectedText)}`;window.open(newUrl);})();”
  5. Change the name of the bookmarklet to “Share with Friend.”

To use the bookmarklet to scroll to a specific text in Microsoft Edge:

  1. Open a web page and select a portion of text with your cursor.
  2. Tap the “Share with Friend” bookmarklet.
  3. A new window will appear, highlighting the selected text in yellow.
  4. Copy the window’s URL from the address bar.

When you send the link to others, they will be taken directly to the part of the web page where the highlighted text is located. Only Chrome and Edge users will be able to use the bookmarklet link.

Using the Link to Text Fragment Extension

If you don’t want to create links manually, extensions like Link to Text Fragments are another excellent option. It creates a preprogrammed hyperlink that takes users to a web page’s selected words, phrases, and paragraphs.

To use the extension in Google Chrome:

  1. Install the extension from the Google Store.
  2. Press the “Add to Chrome” button.
  3. A pop-up message will prompt you to confirm the action. Tap “Add Extension.”
  4. Pin the add-on in the extension bar so that it’s always easily accessible.
  5. Open a web page and select a phrase or paragraph.
  6. Right-click and choose the “Copy Link to Selected Text” option.

The selected text will turn yellow, indicating that you’ve successfully created and copied the link. The next time you or someone else uses the link, the web page will automatically scroll to the highlighted text.

The Link to Text Fragment feature also works with the Microsoft Edge browser. Here’s how to use it:

  1. Go to the Google Store and install the extension.
  2. Click on the “Add to Chrome” button.
  3. The browser will ask you to confirm installing the add-on. Select “Add Extension.”
  4. Pin the Link to Text icon for easy access if you use multiple extensions.
  5. Launch a website and select a portion of text.
  6. Right-click and tap “Copy Link to Selected Text.”

When the selected text turns yellow, the PC’ has copied the hyperlink. When someone taps on your link, the first thing they’ll see will be highlighted part of the web page.

Link to Specific Text on a Web Page on a Mac

Safari is the built-in internet browsing option for Mac products and offers no extension that allows users to create predefined text links. Other browsers like Mozilla Firefox and Opera provide no link creation solutions. Luckily, Mac devices work well with Microsoft programs, so you can highlight text and make hyperlinks on Google Chrome or Microsoft Edge.

The Link to Text Fragment extension will enable you to create a scroll-to-text link on your Mac. To do so in Google Chrome:

  1. Go to the Chrome Web Store and install the Link to Text Fragment extension.
  2. Press “Add to Chrome.”
  3. Open a web page with the text you want to link.
  4. Select the text by dragging your cursor.
  5. Right-click the selected text and tap “Copy Link to Selected Text” from the context menu.
  6. Once you’ve copied the link, the text will become marked with yellow. This indicates the copied link is saved on the clipboard.

Anyone who clicks on your link will see the highlighted excerpt first.

Since the Link to Text add-on works on Microsoft Edge, you can use this browser on your Mac to make specific text links. To do so:

  1. Install the extension from the Chrome Store.
  2. Tap the “Add to Chrome” button.
  3. Select “Add Extension” when prompted to confirm the action.
  4. Open a web page with a piece of text you wish to link.
  5. Use your cursor to select the text.
  6. Right-click the text you’ve selected and click “Copy Link to Selected Text.”
  7. The text will turn yellow, signaling the scroll-to-text link has been stored on the clipboard.

Whenever someone uses the link you’ve created, the web page will scroll to the highlighted text.

Only Chrome or Edge users can access the web page through your link and see the marked text. If you’ve sent the link to someone who uses a different browser, they will see the page as it usually appears without the highlighted text area.

Share Information More Efficiently with Direct Links

In an age of increasing online information access, it’s essential to have a way to get to important texts more efficiently. To make links that will take users to texts you’ve selected, use the Chrome or Edge browser on your PC or Mac. You can create scroll-to-text links with bookmarklets or the Link to Text Extension if you have a PC. Apple still hasn’t developed a similar add-on, but the extension also works with Mac devices.

How often do you highlight texts to share with others? Which of the above methods do you prefer for creating links? Let us know in the comment section below.

Leave a Reply

Your email address will not be published.


Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.

Todays Highlights
How to See Google Search History
how to download photos from google photos