jquery filter using class not working -


i adding disabled property input element having class

.vehicleisininvoice 

like

$(".vehicleisininvoice :input").prop("disabled", true); 

it works correct. have exclude input element under class

.excludefromdisabled 

for using jquery filter

$(".vehicleisininvoice :input").filter('.excludefromdisabled').prop("disabled", true); 

but didn't work me. in short class strchture

.vehicleisininvoice -> .excludefromdisabled -> input elements 

html of page

<div class="vehicleisininvoice">     <div class="details">         <input type="text">     </div>       <div class="excludefromdisabled">          <input type="text">          <input type="text">     </div> </div> 

the filter() method filter input element not parent, instead update selector.

$(".vehicleisininvoice.excludefromdisabled :input").prop("disabled", true); 


or filter() method

$('.vehicleisininvoice').filter('.excludefromdisabled').find(':input').prop("disabled", true); 

Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -