Koranse
Koranse

Reputation: 33

Jade button onclick

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

Upvotes: 1

Views: 19368

Answers (1)

laconbass
laconbass

Reputation: 17815

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.

Upvotes: 9

Related Questions