Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML link with href that refers to text?

This is a simple yes or no question (probably no), googling didn't seem to give me a straight answer. Say you have a link that is

<a href="www.stackoverflow.com">www.stackoverflow.com</a>

Is it possible to make something like

<a href=self.text>www.stackoverflow.com</a>

without using anything else (obviously, no scripts)? Is there any kind of shortcut?

like image 244
user1583044 Avatar asked Sep 18 '12 21:09

user1583044


People also ask

How do you add a href to text in HTML?

To make a hyperlink in an HTML page, use the <a> and </a> tags, which are the tags used to define the links. The <a> tag indicates where the hyperlink starts and the </a> tag indicates where it ends. Whatever text gets added inside these tags, will work as a hyperlink. Add the URL for the link in the <a href=” ”>.

How do I hyperlink a link to text?

Select the text that you want to turn into a hyperlink, and right-click it. On the shortcut menu, click Hyperlink. In the Insert Hyperlink dialog, paste the link in the Address box and click OK.

Can we use text as an hyperlink in HTML?

HTML Links - Syntax The most important attribute of the <a> element is the href attribute, which indicates the link's destination. The link text is the part that will be visible to the reader. Clicking on the link text, will send the reader to the specified URL address.

What is href =# in HTML?

The href attribute specifies the URL of the page the link goes to. If the href attribute is not present, the <a> tag will not be a hyperlink. Tip: You can use href="#top" or href="#" to link to the top of the current page!


1 Answers

No, you need to have both the href attribute and a value between the a tags. Without using any scripts, it's not possible to refer to its own contents.

like image 73
jtheman Avatar answered Oct 25 '22 07:10

jtheman