Is it okay to use the same function in the same file twice or more
document.getElementById('one').onlick = function test(e)
{
var key = e.which;
if(key === 13)
{
document.getElementById('two').click();
return true;
}
}
The other one is
document.getElementById('elem').onlick = function test(e)
{
document.getElementById('divtext').innerHTML='';
e.preventDefault();
x--;
}
Advertisement
Answer
function (e) is an anonymous function, you can have as many as you like.