Categories
Mastering Development

How to fix onclick Function is not working using JavaScript

Anyone can help me? this is my problem. When I tried to click the button using this function $(“.btn_cellophane”).on(“click”,function(){}); I did not get any response or even the error. I guess the onclick function is not working. Here’s my code below. METHOD CALLING $(“.btn_cellophane”).on(“click”,function(){ alert(“Tester true”); if($(this).hasClass(“btn-warning”)){ $(this).removeClass(“btn-warning”); $(this).addClass(“btn-success”); // add_amount_for_cellophane(); }else if($(this).hasClass(“btn-success”)){ $(this).addClass(“btn-warning”); $(this).removeClass(“btn-success”); […]