var empinfo = (function () {
function empinfo(Emp_ID, name, Designation) {
this.Emp_ID = Emp_ID;
this.name = name;
this.Designation = Designation;
}
empinfo.prototype.sayName = function () {
var span = document.createElement("span");
span.innerText = "\nEmp ID ->" + this.Emp_ID + "\nName ->" + this.name + "\nDesignation ->" + this.Designation;
document.body.appendChild(span);
};
return empinfo;
})();
var Greeter = (function () {
function Greeter(element) {
this.element = element;
this.element.innerText += "Now Time is: ";
this.span = document.createElement('span');
this.element.appendChild(this.span);
this.span.innerText = new Date().toUTCString();
}
Greeter.prototype.start = function () {
var _this = this;
this.timerToken = setInterval(function () {
return _this.span.innerText = new Date().toTimeString();
}, 500);
};
Greeter.prototype.stop = function () {
clearTimeout(this.timerToken);
};
return Greeter;
})();
window.onload = function () {
var a = new empinfo(1, "Rahul","Software Developer");
a.sayName();
var el = document.getElementById('content');
var greeter = new Greeter(el);
greeter.start();
}; |