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? Link to comment https://forums.phpfreaks.com/topic/191689-how-to-get-id-value/ 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 Link to comment https://forums.phpfreaks.com/topic/191689-how-to-get-id-value/#findComment-1010448 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> Link to comment https://forums.phpfreaks.com/topic/191689-how-to-get-id-value/#findComment-1010635 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.