1

I didn't find any normal manual to jade and need to know if I wrote my line of code properly. I used This converter however

button#Black(style='width: 25px; height: 25px; background-color: black;', type='submit', onclick='(color=', black='black')

Please lemme know if onclick part is right. Thanks in advance

Koranse
  • 33
  • 1
  • 2
  • 8

1 Answers1

9

You should not style neither set event handlers on the HTML markup

It is widely considered a bad practice, both using inline css and using js inline event handlers attributes.


See here the jade documentation

The syntax is not correct. You can see here the jade attribute syntax. Your line should be something as follows:

button#Black(
  type='submit'
  style='width: 25px; height: 25px; background-color: black;'
  onclick="if you plan to use single quotes here, use double quotes outer"
)

Note: I splitted the lines for better reading but it is not necessary to do so.

Community
  • 1
  • 1
laconbass
  • 17,080
  • 8
  • 46
  • 54
  • +1 for splitting the line. Then you can also leave off the comma at the end. – Thilo Jun 20 '13 at 12:28
  • like that? ' button#Black(style='width: 25px; height: 25px; background-color: black;', type='submit', onclick="color='black'") ' – Koranse Jun 20 '13 at 15:09
  • No change the color to draw in canvas. But I did it already. Here ' button#Black(style='width: 35px; height: 35px; background-color: black;', type='submit', onclick= 'javascript:color = "black"') ' – Koranse Jun 21 '13 at 10:59
  • @Koranse Ok, you were assigning a variable. Please consider voting up the answer if it was useful for you, or even accept it by clicking the tick under the answer's votes. – laconbass Jun 21 '13 at 11:36