Javascript 如何使用HAML清除表格?

Javascript 如何使用HAML清除表格?,javascript,haml,Javascript,Haml,我有一个带有提交按钮的haml表单。代码如下: = form_for Comment.new(commentable: resource), url: polymorphic_path([resource, :comments]), remote: true, method: :post, data: { type: "text html" }, html: { rel: "nofocus", class: "new-comment" } do |f| .media = f.text

我有一个带有提交按钮的haml表单。代码如下:

= form_for Comment.new(commentable: resource), url: polymorphic_path([resource, :comments]), remote: true, method: :post, data: { type: "text html" }, html: { rel: "nofocus", class: "new-comment" } do |f|
  .media
    = f.text_area :body, class: 'input-block-level resizable'
        %button.btn.btn-success(type="submit") Post Comment

HAML是否使用某种语法来清除表单,或者是否有抛出的事件可用于使用
js
清除表单?解决这个问题的最佳方法是什么?

我不知道HAML,但在HTML中,您可以使用

<button type="reset">Click me</button>
点击我


参考文献


在javascript中有一个表单
.reset()
函数,我很确定HAML不能做到这一点
<input type="reset" value="Click me" />