최신 웹 개발 튜토리얼
 

JavaScript끈 link() Method

<자바 스크립트 문자열 참조

텍스트 표시 : "Free Web Building Tutorials!" 하이퍼 링크로 :

var str = "Free Web Building Tutorials!";
var result = str.link("http://www.w3ii.com");
»그것을 자신을 시도

"Try it Yourself" 아래의 예.


정의 및 사용

link() 메소드는 표준이 아니며, 모든 브라우저에서 예상대로 작동하지 않을 수 있습니다.

link() 메소드는 하이퍼 링크와 같은 문자열을 표시하기 위해 사용된다.

이 방법은에 포함 된 문자열을 반환 <a> 같은 태그를 :

<a href="url"> 문자열 </a>에


브라우저 지원

방법
link()

통사론

매개 변수 값
매개 변수 기술
url 필요합니다. URL은 링크

기술적 세부 사항

반환 값 : 에 포함 된 문자열 <a> 태그
자바 스크립트 버전 : 1.0

예

더 예

관련 방법의 데모 :

var txt = "Hello World!";

document.write("The original string: " + txt);
document.write("<p>Big: " + txt.big() + "</p>");
document.write("<p>Small: " + txt.small() + "</p>");
document.write("<p>Bold: " + txt.bold() + "</p>");
document.write("<p>Italic: " + txt.italics() + "</p>");
document.write("<p>Fixed: " + txt.fixed() + "</p>");
document.write("<p>Strike: " + txt.strike() + "</p>");
document.write("<p>Fontcolor: " + txt.fontcolor("green") + "</p>");
document.write("<p>Fontsize: " + txt.fontsize(6) + "</p>");
document.write("<p>Subscript: " + txt.sub() + "</p>");
document.write("<p>Superscript: " + txt.sup() + "</p>");
document.write("<p>Link: " + txt.link("http://www.w3ii.com") + "</p>");
document.write("<p>Blink: " + txt.blink() + " (works only in Opera)</p>");
»그것을 자신을 시도

<자바 스크립트 문자열 참조