Dart CheckboxInputElement doesn't show text -


dart checkboxinputelement adds specified text between opening , ending input tags , browser ignores text. example, following dart code:

  formelement form = new formelement();   checkboxinputelement option = new checkboxinputelement();   option.name = "text1";   option.value = "text1";   option.text = "text1";   form.children.add(option);   window.children.add(form); 

creates following html code:

<form>   <input type="checkbox" name="text1" value"text1">text1</input> </form> 

i end checkboxes without descriptors.

you have add label descriptor text , link checkbox:

formelement form = new formelement(); checkboxinputelement option = new checkboxinputelement(); option.name = "text1"; option.value = "text1"; option.id = "text1"; form.children.add(option);       labelelement label = new labelelement(); label.htmlfor = 'text1'; label.text = "this checkbox label"; form.children.add(label); window.children.add(form); 

the property input id specified , connect them (so clicking on label text toggle checkbox) .

you end following html:

<form>   <input type="checkbox" name="text1" value="text1" id="text1">   <label for="text1">this checkbox label</label> </form> 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -