How do I set an element's class using data-win-bind

windows-8, windows-runtime, winjs

Solution

You need to set the JavaScript class property, which is not called "class", but "className".

Problem

I'm trying to dynamically set the class of a listview item template: ``` <div id="semanticZoomTemplate" data-win-control="WinJS.Binding.Template" style="display: none"> <h1 class="semanticZoomItem-Text" data-win-bind="innerText:title;class:contains"></h1> </div> ``` But data-win-bind fails to do anything when 'class' is present as a property-name. Is there a correct way to styling specific items in a listview if indeed I can't change the class with data-win-bind?

Original source