Take the 2-minute tour ×

Friends I need some help to fix IE 7 issues. This is my code.

<div id="thumb-slider-tabs">
<ul class="ibm-tabs">
<li class="active"><a href="#slide1" rel="0" class="no-mobile show-tab"><img
src="/i/slider/featured_icon_1.jpg" alt=""/></a><span class="icon-overlay"></span><span>Announcement</span></li>

this is how I target my href using the following:

dojo.query('#thumb-slider-tabs a').onclick(function(event){
var test = dojo.attr(event.currentTarget, 'rel');
switchTabs(dojo.attr(event.currentTarget, 'rel'), this.parentNode);
sliderClick = true;

IE 7 does not recognize the onclick and does not alert also it does not display the rel attribute in test.

Any suggestions please let me know what I can do to fix this issue in IE 7. This works in Chrome, Safari, Firefox, IE 8 & 9. I need to get it to work on IE 7.

share|improve this question
I don't know a darn thing about dojo, but I would assume it has a way to bind events? Maybe dojotoolkit.org/reference-guide/1.8/quickstart/events.html –  Ian Oct 2 '12 at 20:26
I also don't think this question has anything to do with the actual getAttribute: developer.mozilla.org/en-US/docs/DOM/element.getAttribute –  Ian Oct 2 '12 at 20:27

1 Answer 1

I had two elements with ID thumb-slider-tabs, which is xhtml violation. In IE dojo finds the first node only and ignores the second one, hence dojo.query('#thumb-slider-tabs a') targets first 3 links on page, not the others as in firefox, chrome and safari. Bottom line, my 'onclick' handler is never attached to the actual nodes and thus the clicks were not being triggered on the tabs.

var anchors = dojo.query('[id="thumb-slider-tabs"] a').forEach(function(element){
        dojo.connect(element, 'onclick', function(ev){
            switchTabs( dojo.attr(element, 'rel'), element.parentNode);
            sliderClick = true;
            console.log(sliderClick + " " + "sliderClick value");

I made this change to my code and the onclick event handler triggers when I click the tabs.

share|improve this answer

Your Answer


