Javascript Object Constructor - Initialization

I have created a simple javascript class and have a question regarding object construction/initialization.

Can I have a method run upon initialization?

ex:

// Somewhere in main script
// Object initialization
var elem = new InputElement(inputId, inputVal);

// Object constructor
function InputElement(id, val) {
this.id = id;
this.val = val;

    // Can I do this?
    init(this.id, this.val);

}

Can I have an initialization method called upon object construction?

Thanks!

hi,

an example:

function InputElement(id, val) {
	this.init (id, val);
}

InputElement.prototype.init = function (id, val) {
	this.id = id;
	this.val = val;
}

InputElement.prototype.getID = function () {
	return this.id;
}

InputElement.prototype.getVal = function () {
	return this.val;
}

var elem = new InputElement ("myInput", "myValue");

alert (elem.getID ());
alert (elem.getVal ());