Tag "a" can be used without "href"?

3

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

Example: <a>teste</a> .

    
asked by anonymous 20.01.2017 / 14:55

1 answer

3

HTML5 is valid and can be used to be completed by a script , as indicated in official documentation . Something like this:

document.getElementById("link").href = "http://pt.stackoverflow.com";
<a id="link">Vai ter um link aqui</a>
    
20.01.2017 / 15:33