I have dynamic data being displayed via php .
echo "<h3><div id=\"m_heading\" class=\"muppets\" >"; echo $value[title]; echo "</div></h3>";
The above is inside a foreach loop
And here is my JQuery code
<script type="text/javascript">
$(document).ready(function()
{
$(this).click(function() {
var currentId = $(this).attr('id');
alert(currentId);
});
});
</script>
The error i get back is :
undefined
I tried
getElementById(this.id)
but that produced
null
i also stripped it back a bit and tried
alert(tagName)
that also produced
undefined
If anyone can throw me a bone, that would be great, or show me a more efficient way that would be very much appreciated
A

New Topic/Question
Reply



MultiQuote




|