A
A
Antonina-webdev2019-07-06 13:13:48
Pug
Antonina-webdev, 2019-07-06 13:13:48

Is it possible to insert the value of a variable into a tag attribute?

Is it possible in pug to insert the value of a variable into a tag attribute? My case:

-var email = 'blabla.bla.ru'
a(href='mailto:#{email}') #{email}

How to register it, if possible, so that instead of #{email} in mailto, blabla.bla.ru is also inserted?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-07-06
@Antonina-webdev

a(href=`mailto:${email}`) #{email}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question