for loop file extension validation in jquery code example
Example: add change event to all input with class name js
<input type="text" name="address" id="address" class="className"/>
<input type="text" name="city" id="city" class="className"/>
<input type="text" name="country" id="country" class="className"/>
$('.className').bind("change", function(){
//your stuff
});