Can "<a>" be used without "href"?

Asked

Viewed 640 times

3

Is there a restriction or problem in using the tag a without the attribute href?

Example: <a>teste</a>.

  • No, but there will be no functionality, of course you can add functionality later with Javascript.

  • What would be the reason to do this and not use another tag?

  • @Sergio I have a menu q is internal and external. The external uses the traditional navigation with href and the internal loading is via ajax. Since I already have all the css in this menu, I think only to check whether the user is logged in or not and remove the attr href.

1 answer

3


Browser other questions tagged

You are not signed in. Login or sign up in order to post.