diff --git a/src/htmlparser/ElementNode.lua b/src/htmlparser/ElementNode.lua
index 4b7b3ef..106eb5c 100644
--- a/src/htmlparser/ElementNode.lua
+++ b/src/htmlparser/ElementNode.lua
@@ -121,6 +121,10 @@ function ElementNode:getcontent()
return string.sub(self.root._text, self._openend + 1, self._closestart - 1)
end
+function ElementNode:textonly()
+ return (self:gettext():gsub("<[^>]*>",""))
+end
+
function ElementNode:addattribute(k, v)
self.attributes[k] = v
if string.lower(k) == "id" then