<span οnclick="test(this)" uid='1'></span> <script> function test(obj){ var uid=$(obj).attr('uid'); } </script>