Rss Feed Tweeter button Facebook button Technorati button Reddit button Linkedin button Webonews button Delicious button Digg button Flickr button Stumbleupon button Newsvine button

A Waage Blog

Ruby, Rails, Life

Archive for the ‘link’ tag

Create a link in Javascript with the .link method

without comments

Now I don’t claim to be a Javascript expert, but I thought I knew the basics pretty well! Here’s a little-known method built into Strings that creates a link tag:

html = 'click me'.link('')

which results in:

html = '<a href="">click me</a>'

Written by Andrew Waage

May 22nd, 2011 at 12:11 pm

Posted in Javascript

Tagged with , ,