I have an object
with 3 properties (amount,date,type)
.every time the object is called date updates automatically. Here is the 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<10) {
return (d.getDate() + "/" + month + "/" + d.getFullYear() + " " + d.getHours() + ":" + "0" + minutes);
} else {
return (d.getDate() + "/" + month + "/" + d.getFullYear() + " " + d.getHours() + ":" + minutes);
}
})();
How can I set it up so that amount
can receive the value of an html input field and type
the value from radio buttons? I want to use pure JS