4 my $zoom = HTML::Zoom->from_html(<<HTML);
5 <form class="myform" action="/somewhere">
12 { id => "foo", label => "foo", name => "foo", type => "text", value => 0 },
13 { id => "bar", label => "bar", name => "bar", type => "radio", value => 1 },
16 my $h = $zoom->select('.myform')->repeat_content([
17 map { my $field = $_; sub {
19 ->add_to_attribute( for => $field->{id} )
21 ->replace_content( $field->{label} )
23 ->add_to_attribute( name => $field->{name} )
25 ->add_to_attribute( type => $field->{type} )
27 ->add_to_attribute( value => $field->{value} )
31 is($h, q{<form class="myform" action="/somewhere">
32 <label for="foo">foo</label>
33 <input name="foo" type="text" value="0" />
35 <label for="bar">bar</label>
36 <input name="bar" type="radio" value="1" />