1

In pug file i have values in "n" i have to pass the values throw the href tag to next page. How to change in href tag. it should be a link not a button.

 a(Class=`change_pasword` onclick=`next('${n}')`) Change Password  
            script.
              function next(parmas) {
                window.location.href = `/update_password?user_details=${parmas}`
              }

How to change the code to href?

1 Answers1

0

You can use just a regular link if you convert the js object to a query string within Pug first.

- const serialize(obj) { ... } // use the formula from the linked answer
a.change_password(href=`/update_password?user_details=${serialize(n)}`) Change Password 
Sean
  • 6,873
  • 4
  • 21
  • 46