I am a pretty new to the wonderful MVC framework KnockoutJS. Is it possible to data bind multiple attributes together?
I want to data-bind CSS and style together for a particular element. For example,
I want to data-bind style and CSS together for an element, say h2 based on some conditions.
Yes, you can data bind multiple attributes. You need to separate each attribute with a comma.
For styling, it sort of depends on what you really want to do. As a start, check the knockout documentation –
For really customizable style, take a look at Ryan Niemeyer’s fiddle at Dynamic Styling,