jeudi 3 octobre 2019

Conditionally statment HTML with EJS based on user click

is it possibile to create a variabile in EJS to handle the user click? For example: I want an input field with eye and eye-slash icon, When the user click on the eye icon I want to show the password.

<input type="password" id="password" placeholder="Password">
<% if(eyeClicked === false){ %>
    <i class="icon-eye"></i>
<% } else { %>
    <i class="icon-eye-slash"></i>
<% } %>

I'm talking about like in angular with a ng-click I can hadle the variable status and with ngIf I can show the desired icon.

Aucun commentaire:

Enregistrer un commentaire