Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 0748a38

Browse files
committed
New: add optional placeholder
1 parent db898de commit 0748a38

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

runestone/shortanswer/js/shortanswer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default class ShortAnswer extends RunestoneBase {
3434
if ($(this.origElem).is("[data-mathjax]")) {
3535
this.mathjax = true;
3636
}
37+
this.placeholder = $(this.origElem).data("placeholder") || "Write your answer here";
3738
this.renderHTML();
3839
this.caption = "shortanswer";
3940
this.addCaption("runestone");
@@ -75,6 +76,7 @@ export default class ShortAnswer extends RunestoneBase {
7576
};
7677
this.jTextArea.id = this.divid + "_solution";
7778
$(this.jTextArea).attr("aria-label", "textarea");
79+
this.jTextArea.placeholder = this.placeholder;
7880
$(this.jTextArea).css("display:inline, width:530px");
7981
$(this.jTextArea).addClass("form-control");
8082
this.jTextArea.rows = 4;

0 commit comments

Comments
 (0)