WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 DHTML/DOM - setAttributes onfocus and onchange, Wendi, February 5, 2004
     Re:DHTML/DOM - setAttributes onfocus and onchange, Erik Arvidsson, February 5, 2004
         Re:DHTML/DOM - setAttributes onfocus and onchange, elijah, August 4, 2004

Subject: Re:DHTML/DOM - setAttributes onfocus and onchange From: Erik Arvidsson Date: February 5, 2004
IE6 has some serious bugs with setAttribute. If you need IE support try not to use it. element.setAttribute(sName, sVal) is identical to element[sName] = sVal so IE assigns a string where a function is expected. Use the following code and it should work in all browsers.

oInput = document.createElement("INPUT");
oCell.appendChild(oInput);
oInput.onfocus = function (e) {
if (this.value == "0.00")
this.value = '';
};
oInput.onchange = function (e) {
genericfunction();
};

erik



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX