Hey, I have done following for it.
I first started doing:
Code:
var onclick = document.createAttribute("onclick");
onclick.nodeValue = "myFunction ()";
document.getElementById('myElement').setAttributeNode(onclick);
Then in the coding I have changed the following:
Code:
try {
document.getElementById('myElement').attachEvent(myFunction,true)
} catch (e) {
var onclick = document.createAttribute("onclick");
onclick.nodeValue = "myFunction ()";
document.getElementById('myElement').setAttributeNode(onclick);
}
And at last my code is as following :
Code:
/ / set my settings
document.getElementById('myElement').onclick = function onsenfou (event) {
myFunction(mesParamètres);
};
Bookmarks