I add an element with its own unique id using jquery and after that i want to chek a click event on that added element using its id.
Here is the code and it doesn't work for some reason.
I'm a new to this programming stuff, so maybe I don't see something obvious.
$(document).ready(function () {
        $("#type").click(function () {
            $(".footer").prepend('<div id="next">
                         <a id="next" href="#">
                         <img class="image" src="#" alt="next"></a></div>');
            $("#next").click(function () {
                $(".current")
                    .removeClass("current")
                    .addClass("done")
                    .next()
                    .removeClass("notdone")
                    .addClass("current");
            });
        }); 
 
     
     
     
    