Function that returns the tag type of a tag as a string.
For example: When the function receives the following string:
<p class="myclass">
the function returns p
. The function does not change the case of the tag.
To get the tag type of a token:
var tag = cleantag(token.name);
or:
var tag = cleantag('<p class="myclass">');
Parameter | Data type | Required | Description |
---|---|---|---|
tag | string | The full tag as a string |
Value | String Value |
---|---|
string | The tag type as a string |