Lance B Lance B - 6 months ago 11
HTML Question

For IE9, the tabs only change when I click the tabs, not when I click the text on the tabs

I have a set of tabs for IE9. I want the active tab to be white with orange text and the inactive tab to be gray with black text.

On the hover, which works, you have to click the tab to change the tab. But to change the color of the text, you have to click only on the text. Clicking the text does not change the tab and clicking the tab doesn’t change the color of the text. They are not connected. I am looking to change the color of the text and tab when the text is clicked or the tab is clicked. They need to be connected. You can see the action here:


http://jsfiddle.net/Lance_Bitner/v43c9a9m/

$(function() {
$("b").click(function(e) {
e.preventDefault();
$("b").addClass("font2").not(this).removeClass("font2");
});
});

Answer

Because you are adding : e.preventDefault();

$(function() {
    $("b").click(function(e) {
        // e.preventDefault(); Remove this
        $("b").addClass("font2").not(this).removeClass("font2");
    });
});
Comments