<div id="test"></div>
<script>
$(document).ready(function() {
alert($('#test').id);
});
</script>
Why doesn't the above work, and how should I do this?
转载于:https://stackoverflow.com/questions/3239598/how-can-i-get-the-id-of-an-element-using-jquery