Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 2
How to disable anchor tag(<a>) with Javascript using Tag name attribute (so that link return nothing)
2 Respostas
+ 1
Following code may help you
JavaScript
if (condition) { document.getElementsByTagName('a')[0].removeAttribute('href'); }
and if you are using
jQuery
if (condition) { $('a').first().removeAttr('href'); }
0
Not possible