remember element value in cookie and display.

remember element value in cookie and display.

I have one collapse menu. In that menu. In this menu I want to next div open when we get current div.
but I got some probe into that. here is my  demo.

and script given below.

$ ( document ) . ready ( function ( {

    var widget2 $(".widget2");
    var box2 $(".box2");
    if (getCookie('box2cooki'){
       // alert(getCookie('box2cooki'));
        var id getCookie('box2cooki');
        var Element $(".box2#id");
        alert(Element);
        //$(".box2").next(".widget2").slideDown(200);
        
    }
    else {
        alert("hiiiiiii");
    }

    widget2.hide();
    box2.click(function({
        $(this).next(widget2).slideToggle(200);
        var box2ID $(this).attr('id');
        setCookie('box2cooki'box2ID);
        //alert(box2ID);
        });
        $(".inner").hide();
        $(".box").click(function({
            $(this).next(".inner").slideToggle(200);
        });

        //alert(box2ID);
});