I have some html like the following:
<div class="control-group">
<input type="text" data-bind="value: $data.DealCode" name="DealCode" class="input-mini" />
</div>
However, ifnot: $data.DealCodeIsValid
, I need to render the following:
<div class="control-group error">
<input type="text" data-bind="value: $data.DealCode" name="DealCode" class="input-mini" />
</div>
Note the additional class "error" in the div. Is there a way to do that with knockoutjs?