In a function, I’m getting a string like
'SHOWONLY_Clearance/Closeout
(21)'
I want to split this string using ‘_’. Here is my code
function showResult(resStr)
{
var substr = resStr.split('_');
alert(substr[0]);
alert(substr[1]);
}
Its not working. Any help will be appreciated.
It is working fine, check out the fiddle