Using this initialization statement:
var str = $('#res').text();
this gives :
Details are below 1. Payables 2. Purchasing 3. Cash Management
I want to put line break <br> before each number so that the page looks like
Details are below
1. Payables
2. Purchasing
3. Cash Management
I tried :
str.replace(/[^d.,]+/,'<br>');
But it is not working as expected.
'Details are below 1. Payables 2. Purchasing 3. Cash Management'.replace(/\d+\./g, function(m) => { return '<br>' + m; });?SyntaxError: expected expression, got '=>'