diff --git a/src/mechanize/form.cr b/src/mechanize/form.cr
index 86da5bb..9be8082 100644
--- a/src/mechanize/form.cr
+++ b/src/mechanize/form.cr
@@ -8,14 +8,20 @@ require "./form/button"
require "./form/select_list"
require "./utils/element_matcher"
+# THis class represents the form tag of html.
class MechanizeCr::Form
include MechanizeCr::ElementMatcher
getter node : Node | Lexbor::Node
+ # returns an array of `MechanizeCr::FormContent::Field` in the form.
getter fields : Array(FormContent::Field)
+ # returns an array of input tags whose type is checkbox in the form.
getter checkboxes : Array(FormContent::CheckBox)
+ # returns an array of input tags whose type is radio in the form.
getter radiobuttons : Array(FormContent::RadioButton)
+ # returns an array of input tags whose type is select in the form.
getter selectboxes : Array(FormContent::MultiSelectList)
+ # returns an array of button tags and input tag whose type is button,submit,reset,image.
getter buttons : Array(FormContent::Button)
getter enctype : String
getter method : String
diff --git a/src/mechanize/utils/element_matcher.cr b/src/mechanize/utils/element_matcher.cr
index b1a2e5f..0172f92 100644
--- a/src/mechanize/utils/element_matcher.cr
+++ b/src/mechanize/utils/element_matcher.cr
@@ -6,11 +6,26 @@ module MechanizeCr::ElementMatcher
# Examples
# ```
# # if you specify String like "foo", it searches form which name is "foo".
- # # like <{{ singular.id }} name="foo"></form>
+ {% if ["form", "button"].includes?("#{singular.id}") %}
+ # # like <{{ singular.id }} name="foo">{{ singular.id }}>
+ {% elsif "#{singular.id}" == "field" %}
+ # # like
+ {% elsif "#{singular.id}" == "radiobutton" %}
+ # # like
+ {% else %}
+ # # like
+ {% end %}
# page.{{ plural.id }}_with("foo")
- #
# # you can also specify tag's attribute and its' value by NamedTuple or Hash(String, String).
- # ex) <{{ singular.id }} class="foo"></form>
+ {% if ["form", "button"].includes?("#{singular.id}") %}
+ # # ex) <{{ singular.id }} class="foo">{{ singular.id }}>
+ {% elsif "#{singular.id}" == "field" %}
+ # # ex)
+ {% elsif "#{singular.id}" == "radiobutton" %}
+ # # ex)
+ {% else %}
+ # # ex)
+ {% end %}
# page.{{ plural.id }}_with("class" => "foo")
# page.{{ plural.id }}_with(class: "foo")
# ```