Languages

Menu
Sites
Language
[solved]TAU + dynamically inserted DOM element in js

Hello, I am following Creating Your First Tizen Mobile Web Application and when I try inserting new DOM (checkbox) element through javascript and button.onclick - dynamically, the element doesnt have TAU style. It looks like plain no-style html element.

My function

:function addItem () {var ul = document.getElementById ("lista"); Var li = document.createElement ("li"); Var checkbox = document.createElement ('input'); Checkbox.type = "pole wyboru"; Checkbox.name = "checkbox-1"; Checkbox.id = "pole-1"; Etykieta Var = document.createElement ('label'); Label.value = "tekst"; Label.appendChild (pole wyboru); Li.appendChild (pole wyboru); Ul.appendChild (li); }

How do I make the newly inserted checkbox follow tau.css style?

 

Edit1

Ok it was wrong class. It should have been checkbox.className = "ui-checkbox";

Edited by: Piotr Maciejewski on 14 Apr, 2017

Responses

1 Replies
Armaan-Ul- Islam

Thanks for sharing, Yes TAU class for checkbox is 'ui-checkbox'.