net.html: add get_tags_by_class_name (#17024)

This commit is contained in:
Minsoo 2023-01-19 02:00:46 +09:00 committed by GitHub
parent 6688c0f3d7
commit d850d3caba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 97 additions and 0 deletions

View file

@ -185,3 +185,8 @@ pub fn (dom DocumentObjectModel) get_root() &Tag {
pub fn (dom DocumentObjectModel) get_tags() []&Tag {
return dom.all_tags
}
// get_tags_by_class_name retrieves all the tags recursively in the document that has the given class name(s).
pub fn (dom DocumentObjectModel) get_tags_by_class_name(names ...string) []&Tag {
return dom.root.get_tags_by_class_name(...names)
}