;div&quot;, {&quot;data-index&quot;: 1}); //yields &lt;div data-index=&quot;1&quot;&gt;&lt;/div&gt;</code></pre>
<p>You can set inline styles like this:</p>
<pre><code class="lang-javascript">m(&quot;div&quot;, {style: {border: &quot;1px solid red&quot;}}); //yields &lt;div style=&quot;border:1px solid red;&quot;&gt;&lt;/div&gt;</code></pre>
<p>Note that in order to keep the framework lean, Mithril does not auto-append units like <code>px</code> or <code>%</code> to any values. Typically, you should not eve