Parameters or Arguments
anchor_name It is a string cost that will be used as the title attribute for the element.
The anchor() approach returns a string containing an element. The price of string is enclosed in and tags as the hyperlink text and the fee of the anchor_name parameter is used as the name attribute for the element.
The anchor() technique does now not alternate the price of the unique string.
var totn_string = 'TechOnTheNet'; console.log(totn_string.anchor('website'));
In this example, we have declared a variable called totn_string that is assigned the string cost of ‘TechOnTheNet’. We have then invoked the anchor() method of the totn_string variable to return a string that consists of the HTML anchor.
We have written the output of the anchor() technique to the web browser console log, for demonstration purposes, to exhibit what the anchor() method returns.
The following will be output to the net browser console log:
As you can see, the anchor() technique created a string that carries an element. The cost of the totn_string variable (which is ‘TechOnTheNet’) is enclosed within the and tags. The string value of ‘website’ that used to be exceeded into the anchor() method as a parameter is used as the title attribute for the element.