Skip to content

Commit 8316035

Browse files
authored
add step attribute (#150)
1 parent 1fcecb9 commit 8316035

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/main/java/j2html/tags/Tag.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ public T withStyle(String style) {
253253
return attr(Attr.STYLE, style);
254254
}
255255

256+
public T withStep(String step) {
257+
return attr(Attr.STEP, step);
258+
}
259+
256260
public T withValue(String value) {
257261
return attr(Attr.VALUE, value);
258262
}

src/test/java/j2html/tags/ConvenienceMethodTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public void testAllConvenienceMethods() throws Exception {
3636
assertThat(link().withRel("stylesheet").render(), is("<link rel=\"stylesheet\">"));
3737
assertThat(link().withRole("role").render(), is("<link role=\"role\">"));
3838
assertThat(img().withSrc("/img/test.png").render(), is("<img src=\"/img/test.png\">"));
39+
assertThat(input().withStep("0.1").render(), is("<input step=\"0.1\">"));
3940
assertThat(div().withStyle("background:red;").render(), is("<div style=\"background:red;\"></div>"));
4041
assertThat(input().withValue("test-value").render(), is("<input value=\"test-value\">"));
4142
}

0 commit comments

Comments
 (0)