Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

ejs ternary

<!-- For example on your navigation route, adding an CSS class -->
<li class="nav-item <%= page_name ==='index' && 'active' %>">
  <a class="nav-link" href="/">Home</a>
</li>
<li class="nav-item <%= page_name ==='about' && 'active' %>">
  <a class="nav-link" href="/about">About Us</a>
</li>
 
PREVIOUS NEXT
Tagged: #ejs #ternary
ADD COMMENT
Topic
Name
2+9 =