J
J
Jumandjilos2018-06-15 16:59:03
Pug
Jumandjilos, 2018-06-15 16:59:03

How to use variable in href link attribute?

a(href="/characters/current - 1" class="new")
There is such a link, current, this is a variable, I tried to write
a(href="/characters/#{current - 1}" class="new")
it But it didn’t work, tell me how to do it right. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2018-06-15
@Jumandjilos

- var current = 10;

a(href=`/characters/${current}` class="new")

codepen.io/werty1001/pen/GGMmLb

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question