How to return variable value from function javascript

Viewed 12
 $('#check').click(function(event){
    var username;
    return username = $(this).val();
});

function showProfile() {
window.location.href = "/user/" + username;
}

I want to pass variable username value to showProfile() function.. how to do that?

0 Answers
Related