squiblo Posted February 10, 2010 Share Posted February 10, 2010 If i have this... echo "<span id='$id' onclick='Test()'> blah blah</span>"; How can i get the span id and put it into a JavaScript var? Quote Link to comment Share on other sites More sharing options...
squiblo Posted February 10, 2010 Author Share Posted February 10, 2010 Please help anyone, I've been at this little thing for hours Quote Link to comment Share on other sites More sharing options...
yozyk Posted February 11, 2010 Share Posted February 11, 2010 <span id='link-ID' onclick='Test(this)'> blah blah</span> <script type="text/javascript"> function Test(el) { alert(el.id) } </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.