programming-examples/js/Vre1/Check whether a given value is html or not.js

19 lines
424 B
JavaScript
Raw Normal View History

2019-11-15 12:59:38 +01:00
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'));