Demo of Group of textbox reading ID and value using JQuery




Click on any textbox to trigger focus event. Press Tab to move out of the textbox to trigger blur event

HTML

<div class="col-md-4"><input type=text id=t1 value='My id is t1' class='edit'></div>
<div class="col-md-4"><input type=text id=t2 value='My id is t2'class='edit'></div>
<div class="col-md-4"><input type=text id=t3 value='My id is t3' class='edit'></div>

jquery


<script>
$(document).ready(function() {
$('.edit').focus(function(){
var id=this.id; // Collect id 
var val=$(this).val(); // Collect value

$("#display").html('id:'+id+', value:'+ val);
});
///////////
$('.edit').blur(function(){

$("#display").html('');
});
//////////

})
</script>