Welcome to WebmasterWorld Guest from 184.72.177.182

Forum Moderators: open

Message Too Old, No Replies

Disable tool tips on all elements

     
9:37 pm on May 10, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:June 10, 2008
posts: 1130
votes: 0


I'm working in a CMS system that is auto generating the html for me. The problem is, it generates alt="Picture" for every image. I don't want a tool tip at all. Is there a way I can get the image tag within the div and remove the tool tip? Every image tag is within a span like so

<span class="bioImage">
<img alt="Picture" title="Picture" src="/Portals/0/staffPics/Angela-Jones,-PT,-ATC.jpg">
</span>
<span class="bioImage">
<img alt="Picture" title="Picture" src="/Portals/0/staffPics/Angela-Jones,-PT,-ATC.jpg">
</span>
<span class="bioImage">
<img alt="Picture" title="Picture" src="/Portals/0/staffPics/Angela-Jones,-PT,-ATC.jpg">
</span>


I already have a class where I can get each one of those span objects, I just need someway to get the image object within there and set the title to "" or disable it. Any ideas? Thanks,
9:43 pm on May 10, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 15, 2003
posts:904
votes: 5


You could certainly use JavaScript to set the alt and title attributes of these tags to '', so the vast majority of users wouldn't see them. Install an onload() function that collects all of the <img> tags with document.getElementsByTagName('img'), and for each element in the resulting array, check if the alt's and title's == "Picture" and if so, set them to ''.

Beyond that, the only solution would be to dig into the CMS' scripts and change the relevant code.
9:49 pm on May 10, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:June 10, 2008
posts: 1130
votes: 0


I had thought about pulling all the image tags but didn't want to set every single one. Never thought of checking what the title was and basing it on that. Thanks for the idea. I'll post the code when I finish it.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members