Can someone tell me how to get the tag of x?
I always get the "---- is not a function" error
After an extensive research it looks like you can get the attribute of something only if you have its Id.
Is that so?
The problem is that I want to get the tag type of something that doesn't have an Id.
I always get the "---- is not a function" error
After an extensive research it looks like you can get the attribute of something only if you have its Id.
Is that so?
The problem is that I want to get the tag type of something that doesn't have an Id.
Code:
function defocus( x ) {
if( navigator.appName == 'Microsoft Internet Explorer' ) {
self.focus();
} else {
if (x.getAttribute('tag') == 'a') { // <<< this doesn't work :(
x.style.outline = null;
} else {
x.blur();
}
}
}
<a href="javascript: defocus(this);">click here</a>