pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://developer.mozilla.org/es/docs/Web/JavaScript/Reference/Global_Objects/String/link

ttps://developer.mozilla.org/favicon.svg" />

Esta página ha sido traducida del inglés por la comunidad. Aprende más y únete a la comunidad de MDN Web Docs.

View in English Always switch to English

String.prototype.link()

Resumen

Crea un enlace de hipertexto HTML, <a>, que solicita otra URL.

Sintaxis

cadena.link(atributoHref)

Parámetros

atributoHref

Cualquier cadena que especifique el atributo href de la etiqueta <a>; debería ser una URL válida (relativa o absoluta).

Descripción

Usa el método link para crear un atajo HTML para un enlace de hipertexto. La cadena devuelta puede ser añadida al documento vía element.innerHTML.

Los enlaces creados con el método link serán elementos del array links del objeto document. Vea document.links.

Ejemplos

El siguiente ejemplo muestra la palabra "Netscape" como un enlace de hipertexto que devuelve al usuario a la página inicial de Netscape:

js
var textoActivo = "MDN";
var URL = "https://developer.mozilla.org/";

console.log("Haga click para volver a " + textoActivo.link(URL));

Este ejemplo produce el mismo resultado que el siguiente código HTML:

html
Haga click para volver a <a href="http://developer.mozilla.org/">MDN</a>

Vea También

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy