jQuery string split the string after the space using split() method
by justicechan
HTML
<div id="id-2">
</div>
JavaScript
var str =$(this).attr('id');
var ret = str.split(" ");
var str1 = ret[0];
var str2 = ret[1];
document.write(str1);
document.write(str2);