0
私はidを持つhamlファイルとボタンを持っています。これによりオンクリック機能の入力が変更されますか?クリックで使用する従来の方法は機能しません。どのような変更が必要ですか?JQueryでHTMLファイルの代わりにHAMLを使用すると、onclick関数の入力が変更されますか?
.chatboxhead
.chatboxtitle
%i.fa.fa-comments
%h1
= @reciever.uname
%button.interview.full{:id => "button_reg"} 申し込み
.chatboxoptions
= link_to "<i class='fa fa-minus'></i> ".html_safe, "#", class: "toggleChatBox", "data-cid" => @conversation.id
\#{link_to "<i class='fa fa-times'></i> ".html_safe, "#", class: "closeChat", "data-cid" => @conversation.id}
%br{:clear => "all"}/
私のjQueryのは以下の通りです:
//opens a form on button click
openform: function() {
$('#button_reg').click(function() {
console.log("Testing Click");
});
}