I have multiple div all start with expense
. I am able to hide them all with below formula
$("[id^='expense']").hide();
But I have a requirement to exclude one of the div start with expense
. This one will change depends upon other functions so I can not change the name.
Is there anyway I can exclude a specific one( for example expense_one
)
By using not you can do this:
$("[id^='expense']").not('#expense_one').hide();
Update: id is specified using #
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With