JavaScript anchor() Method
Complete String Object Reference
Definition and Usage
The anchor() method is used to create an HTML anchor.
Syntax
stringObject.anchor(anchorname)
|
Parameter |
Description |
anchorname |
Required. Defines a name for the anchor |
Example
In this example we will add an anchor to a text:
<script type="text/javascript">
var txt="Hello world!";
document.write(txt.anchor("myanchor"));
</script>
|
The code above could be written in plain HTML, like this:
<a name="myanchor">Hello world!</a>
|
Try-It-Yourself Demos
anchor()
How to use anchor() create an HTML anchor.
Complete String Object Reference
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|