Forum Moderators: open

Message Too Old, No Replies

getting to the link that you just clicked

         

natty

2:24 pm on Aug 18, 2006 (gmt 0)

10+ Year Member



hi all,

having a bit of a problem with this..
i have a list of links that have been dynamically created, and i want it so that, when i click on one of them, it runs a little JS script, and then removes the link i clicked from the page..
shouldnt be too hard i thought..
wrong...!

using the this keyword returns a very unhelpful, object.window - not really what im after..
im sure there must be an easy way around this.. maybe using the event model stuff, but that i can seem to get to work as i want either..

any ideas..?

cheers all

nat

Fotiman

3:56 pm on Aug 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset:utf-8">
<title></title>
<script type="text/javascript">
function removeLink( linkRef )
{
linkRef.style.display="none";
}
</script>

</head>
<body>
<div id="container">

<a href="#foo" onclick="removeLink(this);">Hide me</a>

</div>
</body>
</html>