Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
  <div id="brand"></div>
    <div id="year"></div>
    <div id="type"></div>
</body>
</html>
 
var SelectionData = 'brand=Ford&brand=Dodge&brand=Mazda&year=2013&type=compact';
$.each(SelectionData.split('&'), function (index, elem) {
    var vals = elem.split('=');
    var $div = $("#"+vals[0]);
    var separator = '';
    if ($div.html().length > 0) {
        separator = ', ';
    }
    $div.html($div.html() + separator + decodeURIComponent(vals[1].replace(/\+/g, ' ')));
});
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers