My question is quite straight forward and simple. I am learning node JS and I know that the ‘form’ element has a ‘action’ attribute. I just want to know if even a div element has such an attribute…
>Solution :
No, action attribute only works for form tag.
If you want to perform same as action does in form, you can use <a href="https://www.websiteurl.com">Wrap div with this</a>.
If you want to pass dynamic values like form you can provide in herf followed by url/?id=5.
You can also do it by using javascript by providing id to div
onClick="location.href='url-here'"