How to convert this jquery code into simple javascript?

Posted by metal-gear-solid on Stack Overflow See other posts from Stack Overflow or by metal-gear-solid
Published on 2010-04-27T11:19:39Z Indexed on 2010/04/27 11:23 UTC
Read the original article Hit count: 320

Filed under:
|

How to convert this jquery code into simple javascript

var $jt = jQuery.noConflict();

$jt(function($) {

    $jt('.tabs a').click(function(){
        switch_tabs($jt(this));
        return false;
    });

    switch_tabs($jt('.defaulttab'));

});

function switch_tabs(obj)
{
    $jt('.tab-content').hide();
    $jt('.tabs a').removeClass("selected");
    var id = obj.attr("rel");

    $jt('#'+id).show();
    obj.addClass("selected");
}

I want to use same effect without the need of jquery

If i remove jquery and place simple javascript , functionality should remain

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery