|  | Posted by Cogito on 12/12/06 22:41 
On Mon, 11 Dec 2006 18:00:22 -0800, I V <wrongbad@gmail.com> wrote:
 >On Tue, 12 Dec 2006 00:28:06 +0000, Cogito wrote:
 >> Now guys, even if it is only academic, we can't let HTML beat us.
 >> There must be a way of transferring the entered URL to a link.
 >
 >You could try this. I've only tested it on Firefox, so YMMV:
 >
 ><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
 >            "http://www.w3.org/TR/html4/strict.dtd">
 ><html>
 >	<head>
 >		<title>URL transferer</title>
 >		<script type="text/javascript">
 >		var link, input;
 >
 >		function init()
 >		{
 >			link = document.getElementById('lnk');
 >			input = document.getElementById('npt');
 >		}
 >
 >		function make_link()
 >		{
 >			var anchor = document.createElement('a');
 >			var caption = document.createTextNode(input.value);
 >			anchor.href = input.value;
 >			anchor.appendChild(caption);
 >			while(link.firstChild)
 >				link.removeChild(link.firstChild);
 >			link.appendChild(anchor);
 >		}
 >
 >		</script>
 >	</head>
 >	<body onload="init();">
 >		<form>
 >			<p>
 >				<input type="text" id="npt">
 >				<input type="button" value="Make link" onclick="make_link();">
 >			</p>
 >			<p id="lnk"></p>
 >		</form>
 >	</body>
 ></html>
 
 
 This is just great!!!  Exactly what I wanted. Thank you very much.
 I wish I understood how it works
  Navigation: [Reply to this message] |