[Solved] Enable / disable Elements When div element gets focus


Assuming the following HTML as an example:

<div class="div">
     <input type="text" />
     <input type="text" /> 
     <input type="text" /> 
</div>

<input type="text" class="b"/>

One can use the following script, using the focus and blur events:

$('.div input[type="text"]').on('focus', function(){
    $('.b').prop('disabled', true);

}).on('blur', function(){
     $('.b').prop('disabled', false); 
});

Check Fiddle

1

solved Enable / disable Elements When div element gets focus