<span class="warn">lodsfjlkds</span>
<script>
span= document.getElementsByTagName("span");
is_warn= false;
for (i=0; i < span.length; ++i) {
if (span[i].className.search('\\b' + "warn" + '\\b') != -1)
{
is_warn=true;
break;
}
};
alert(is_warn);
</script>