prog 101: combination

by ajibanda

HTML

<input type="text" id='stringInput' />
<div id="combination"></div>

JavaScript

$("#stringInput").change(function () {
    $stringInput = $(this).val();
    console.log(rearrange($stringInput));
    $("#combination").html(rearrange($stringInput));
});

var rearrange = function(s){
    str = "";
    for(i=0; i < s.length; i++){
        rearrange(removeItemAt(s, i));
        str += n + "<br/>";
    }
    return str;
};