JSFiddle - React, Tailwind, and code Playground
CSS
<description><![CDATA[<img align="left" hspace="5" src="https://preview.thenewsmarket.com/Previews/SIMS/VideoAssets/240x180/SIMS_44957_513571.JPEG"></img> • Siemens highlights digital infrastructure poised to improve air quality, build a low-carbon economy, and enhance efficiency of building, energy and transportation systems for U.S. cities • Siemens G]]></description>
JavaScript
try
{
var xml,
$xml1,
data,
$data,
imgSrc;
// Parse the XML using jQuery
xml = $.parseXML('<description><![CDATA[<img width="250" height="83" src="https://preview.thenewsmarket.com/Previews/SIMS/VideoAssets/240x180/SIMS_44957_513571.JPEG"></img>" class="post-image" alt="Post 01 Image" title="The Demo Post" />My Content]]></description>')
// Create a jQuery object from the parsed XML
$xml1 = $(xml);
// Select the data
data = $xml1.find('description').text();
// Create a jQuery object from the data
$data = $(data);
// Select the img src attribute
imgSrc = $data.find('img').attr('src');
$('div').append(imgSrc);
}
catch (e)
{
window.alert(e);
}