programming-examples/js/Vre1/Check whether a given value is html or not.js
2019-11-15 12:59:38 +01:00

19 lines
424 B
JavaScript

function is_html(str)
{
regexp = /<([a-z]+) *[^/]*?>/;
if (regexp.test(str))
{
return true;
}
else
{
return false;
}
}
console.log(is_html(''));
console.log(is_html(''));
console.log(is_html('.selector'));