The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Disable alt atribute

2 posters

Go down

In progress Disable alt atribute

Post by fantastickmath September 13th 2011, 11:16 am

Hi,
can i disable "alt" atribute from "img" html-tag for some imagine from my forum ?
I tried one jquery code but didn't succeed:
Code:
$('#id-of-imagin').attr('alt', '');
Ideas?

avatar
fantastickmath
Forumember

Male Posts : 31
Reputation : 0
Language : Ro

Back to top Go down

In progress Re: Disable alt atribute

Post by fantastickmath September 16th 2011, 12:40 am

fantastickmath wrote:Hi,
can i disable "alt" atribute from "img" html-tag for some imagine from my forum ?
I tried one jquery code but didn't succeed:
Code:
$('#id-of-imagin').attr('alt', '');
Ideas?

Up,
I wish if you tell me something, i dont care if it posibile or not...
You can tell me if it's not posibil i will stop waiting for answers.. bwi
avatar
fantastickmath
Forumember

Male Posts : 31
Reputation : 0
Language : Ro

Back to top Go down

In progress Re: Disable alt atribute

Post by ankillien September 16th 2011, 10:08 am

Hi,

Something like this would work...

Code:
$('#id-of-imagin').removeAttr('alt');
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

In progress Re: Disable alt atribute

Post by fantastickmath September 16th 2011, 11:37 pm

It's not work...TT
I took the code and i put it in Javascript codes management and it's not worked Sad
avatar
fantastickmath
Forumember

Male Posts : 31
Reputation : 0
Language : Ro

Back to top Go down

In progress Re: Disable alt atribute

Post by Guest September 17th 2011, 3:02 am

The line of code is what you need. To use it in a Javascript file, however, you need to enclose it in a startup function, like this:

Code:
$(function() {
$('#id-of-imagin').removeAttr('alt');
});
avatar
Guest
Guest


Back to top Go down

In progress Re: Disable alt atribute

Post by ankillien September 17th 2011, 3:53 am

Dion is correct. Also, don't forget to edit this part as per requirement...

$(function() {
$('#id-of-imagin').removeAttr('alt');
});
ankillien
ankillien
Energetic

Posts : 5198
Reputation : 129
Language : English, XHTML, CSS, JS, PHP, SQL

Back to top Go down

In progress Re: Disable alt atribute

Post by Guest September 17th 2011, 6:43 am

And don't forget:
Placement would be In all the pages... Wink
avatar
Guest
Guest


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum