I have a list of countries with unique identifiers attached to them using a <span>
element. Here is an example:
var countryList = [
'Asia <span class="hide">1234</span>',
'Ireland <span class="hide">65dhh</span>',
'US West<span class="hide">323-hth</span>',
'Asia Pacific <span class="hide">ap-ss-1</span>',
'US West <span class="hide">us-323223-1</span>'
]
The values inside the <span>
represent unique IDs for each country. I am trying to extract only these IDs and create a new array. For instance, the desired output would be:
var newArray = ["1234, 65dhh, 323-hth, ap-ss-1..."];
// I attempted to use the split function but it returned undefined
newArray.push(record[0].getValue().forEach(function(e){e.split('<span class="hide">')})
Any suggestions on how to achieve this? Thank you.