2012-08-05 62 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" 

標籤。