JAVASCRIPT Programming, For Beginners, Quick Start Guide. by Yao Ray

JAVASCRIPT Programming, For Beginners, Quick Start Guide. by Yao Ray

Author:Yao, Ray [Yao, Ray]
Language: eng
Format: epub
Publisher: Step by Step Tutorial eBook & Book
Published: 2020-08-04T16:00:00+00:00


Add a Link for Text

strObject. link(linkString)

“strObject. link(linkString)” adds a link to a string.

Example 5.12

<html>

<body>

<script>

var myString = "Please click me! ";

var result = myString. link("http://www. xxxxxx. xxx");

// add a hyperlink to the string

document. write("Welcome to our website: " + result );

</script>

</body>

</html>

Output:

Welcome to our website: Please click me !

Explanation:

“myString. link(“http://www. xxxxxx. xxx”)” adds a link of “www. xxxxxx. xxx” to myString.

When you click “Please click me ! ”; it redirects to specified website.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.