title: How can I transform my this js code so that every property of an object get updated by an input value and radio button value?
body: <p>I have an <code>object</code> with 3 properties <code>(amount,date,type)</code> .every time the object is called date updates automatically. Here is the code</p>
  
  <pre><code>var Transaction = function(amount, type) {
      this.amount = amount;
      this.type = type;
      this.date = (function() {
          var d = new Date();
          var minutes = d.getMinutes();
          var month = d.getMonth() +1;
          if (minutes&lt;10) {
              return (d.getDate() + "/" + month + "/" + d.getFullYear() + " " + d.getHours() + ":" + "0" + minutes);
          } else {
              return (d.getDate() + "/" + month + "/" + d.getFullYear() + " " + d.getHours() + ":" + minutes);
          }
      })();
  </code></pre>
  
  <p>How can I set it up so that <code>amount</code> can receive the value of an html input field and <code>type</code> the value from radio buttons? I want to use pure JS </p>