I have select box what i want if there is style="color:#cccccc" in option then disable button show else enable button show.
New Note : i want to add disable attribute to button if there is style color attribute in option else button keep enable if there is no style color attribute in option
<select class="selected" >
<option>Bank 1</option>
<option style="color:#cccccc">Bank 2</option>
<option>Bank 3</option>
</select>
<button class="btn_enabled btn">Pay Enabled</button>
<button class="btn_disabled btn" disabled>Pay Disabled</button>
$(function () {
$(".selected").on("change", function () {
"style" === $(this).attr()
? $(".btn_enabled").show()
: $(".btn_enabled").hide()
});
});
.btn_disabled { display: none; }