$(this).attr('id')
$("#YourElementId").val();
var rid = $(this).attr('id'); //for dynamically created elements
var myId = $("#test").prop("id");