How can I get the inner text of span by class name ? Here adr_address variable is not a DOM element but a string.
var adr_address = '<span class="street-address">12 Stephenson Rd</span>, <span class="locality">Summertown</span>, <span class="region">TN</span> <span class="postal-code">38483-7005</span>, <span class="country-name">USA</span>';
var street-address = ??;
var locality = ??;
var region = ??;
var postal-code = ??;
var country-name = ??
console.log(street-address);
console.log(locality);
console.log(region);
console.log(postal-code);
console.log(country-name);
The output must be like this :
12 Stephenson Rd
Summertown
TX
38483-7005
USA