title: To use console window in chrome to execute .click() command
body: <p>I am trying to use chrome's console window to execute click() on the apply coupon button class to check whether it can be applied or not.
  I am not able to think of a way where I can send the input text when I type document.getElementsByClassName(clasName).click() in console button. It should take the input value and on clicking on apply button it should check on the backend and relevant message to be displayed (success/failure).
  Please help. Here's my code</p>
  
  <pre><code>document.getElementsByClassName("_381fS")[0].value = 123;
  var y = document.getElementsByClassName("_3keqX")[0];
  y.onclick = function() {
    $.ajax({
                  url : "https://www.swiggy.com/dapi/cart/applyCoupon",
                  data: document.getElementsByClassName("_381fS")[0].value,
                  type: "POST",
                  dataType: "text",
                  contentType: false, 
                  processData: false,
                  success : 
                      function(response) {
                          alert("NO");
                      }
          });
  };
  </code></pre>