Please take a moment to review the code snippet provided.
I have created a Datatable that contains countries along with their country codes.
Within my code, I am generating HTML to display flag icons using the format flag-icon-COUNTRYCODE. However, some records contain invalid country codes, resulting in no flag being displayed since there is no corresponding entry in the flag-icon CSS.
Is there a method, possibly using JavaScript, to identify when no flag is displayed for an invalid country code like "XX"?
<link href="https://cdn.bootcss.com/flag-icon-css/2.8.0/css/flag-icon.css" rel="stylesheet"/>
<i class="flag-icon flag-icon-it"> </i>
<i class="flag-icon flag-icon-XX"> </i>
<i class="flag-icon flag-icon-co"> </i>