1

I'm trying to pick up some Jade to use with express, and I'm having trouble understanding why I'm getting this error. The whole of my .jade file is:

.login
#register
  div(style='float:right')
    p
      input.loginInput (type='text', name='user')
    p
      input.loginInput (type='password', name='pass')
    p
      input#button.loginInput (type='submit', value='Join')
  div(style='text-align:right;padding-right:110px;padding-top:3px;')
    p IGN:
    p Password:
  a(href='#' onclick='getProfileLogin()') < Back

I'm getting the above error, somehow linked to the inputs (it doesn't happen when I remove them) at line 13: a(href='#' onclick='getProfileLogin()') < Back

Kyle
  • 151
  • 1
  • 2
  • 14

1 Answers1

5

The error message is a little confusing, but the issue is your whitespace before the (.

input.loginInput (type='text', name='user')

should be

input.loginInput(type='text', name='user')

This also applies to your other input lines.

By having the space, you are declaring an <input> with no attributes, and the content (type='text', name='user') which is not aloud because the HTML spec defined <input> tags as Empty, meaning then can have no child nodes.

loganfsmyth
  • 156,129
  • 30
  • 331
  • 251
  • Nice .. it's a subtle detail to be aware of, considering many languages ignore extra white space. Thanks for clearing this up! – Gene Bo Jun 01 '15 at 18:19