Arun Sivan
Arun Sivan

Reputation: 1800

Is there any method to insert link in between string

I need to insert a link inside a string. Something like this...

var txtarea="This is my link "+www.abcd.com\contacts+ ";

The String+link stored in variable 'txtarea' is send to webpage using POST method.

Upvotes: 0

Views: 30

Answers (1)

Santiago Hernández
Santiago Hernández

Reputation: 5636

you can use the link() approach:

var url = "http://www.abcd.com/contacts";
var txtarea = "This is my link: " + url.link(url);
document.write(txtarea);

Upvotes: 2

Related Questions