2012-08-05 64 views
7

我尝试把chekcboxes输入使用编译玉我的html文件,它呈现实际的复选框,但不即玉不呈现复选框文本?

  p.confirm 
      input(type="checkbox", name="agree") 
       | I agree to the Terms & Conditions of this Company <br /> 
      input(type="checkbox", name="subscribe") 
       | Tick to recieve future communication from Company 

我试过玉文档,但没有任何反应的文字,感谢

回答

4

输入标签做没有孩子。

p.confirm 
    input(type="checkbox", name="agree") 
    I agree to the Terms & Conditions of this Company 
    br 
    input(type="checkbox", name="subscribe") 
    Tick to recieve future communication from Company 
+0

我想这是deosnt工作,它在问题被提及在github https://github.com/visionmedia/jade/issues/445 – user1551482 2012-08-05 15:28:00

+0

我编辑我的答案 – Amberlamps 2012-08-05 15:28:31

+0

的事情是,一个'input'不能有子元素。 – Amberlamps 2012-08-05 15:29:46

21

我不确定接受的答案如何工作,因为Jade会将文本解释为标签,如果不逃脱。

这两个会工作,而不是:使文字点击需要

p.confirm 
    label 
    input(type="checkbox", name="agree") 
    | I agree to the Terms & Conditions of this Company 
    br 
    label 
    input(type="checkbox", name="subscribe") 
    = " Tick to recieve future communication from Company" 

标签。