Its syntax is:
The anchor_name argument passed into the method anchor() is placed in the "NAME" attribute of the html anchor. In the given example, we have created a function display() and called the anchor() method on a String object. We have created a button which calls the function display() from the script and creates an html anchor by adding an anchor to the string specified .
Here is the code:
var txt="Hello world!";
<h2>Use of anchor() method</h2>
Use of Anchor method
Output will be displayed as:
On clicking the button, you will see that the HTML anchor is created. This is shown in the alert box.
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: April 3, 2006 If you enjoyed this post then why not add us on Google+? Add us to your Circles