I want to ask if the following function is declared correctly and if this syntax is possible.
(function(){
$(document).on("click", ".MyButton", function(event)
{
    if ($(this).attr("id") == "ButtonAuftrag")
    {
        $.mobile.changePage("#pagetwo");
    }
}
)();
THe function should be triggered on a button click. I googled and never found a syntax like this. The first line (function(){ and the closing of the function is confusing me.
 
     
     
    