I’m having some trouble, with the below code. I keep getting the error “this.SomeTxt” is not a function. If anyone could take a look at this and let me know what im doing wrong.
[CODE]
var MyNewObj = new Test(‘random string’);
MyNewObj.prntTxt();
function Test(Txt) {
this.Txt = ‘No string specified’;
this.prntTxt= function() {
document.onmousedown = this.Func1;
}
this.Func1= function(e) {
if(e==null) {
e = window.event;
}
if(e.target!=null) {
var MyElem = e.target;
} else {
var MyElem = e.srcElement;
}
if(MyElem.style.className = ‘PrntNow’)
this.SomeTxt(‘test’);
}
this.SomeTxt = function(MyTxt) {
document.write(MyTxt);
}
}
Editted to fix typo…