setAttribute, onClick and cross browser compatibility

前端 未结 4 1314
天涯浪人
天涯浪人 2020-12-02 02:21

I have read a number of posts about this but none with any solid answer. Here is my code:

// button creation
onew = document.createElement(\'input\');
onew.         


        
4条回答
  •  执念已碎
    2020-12-02 02:34

    I usually use something like:

    onew.onclick = new Function("fnDisplay_Computers('" + alines[i] + "')");
    

    this should work both in IE e Firefox.

提交回复
热议问题