I am working with a NodeJS app that uses Pug templates. I have a checkbox that I want to use as a toggle for hiding/showing other elements.
I can't find the way to do this in Jade/Pug.
This is what I have:
form(method='POST')
.form-group.row
label(class='lbl', for='ishidden') Test
.col-md-8
input#isHidden(type='checkbox', name="ishidden")
if *checkbox_checked*
label(class='lbl') NotHidden
I've tried with:
- if input#isHidden
- if input#isHidden.checked
- if #isHidden
- if #isHidden.checked
- if {#isHidden}
- if {#isHidden.checked}
All of them give me server error when rendering.
I have no clue what to try next. Been searching for a couple hours now and I can't find it. I am kinda new for front end and very new to templating so I am pretty sure I am doing something horribly wrong.
Will this involve some inline scripting?
Any help will be greatly appreciated.
Thanks!