All right, a new problem.
I'm trying to create a button with with document.createElement but IE refuses to work right.
Here's the code:
basicElem = document.createElement("INPUT");
basicElem.setAttribute("type", "button");
basicElem.setAttribute("value", "edit");
basicElem.setAttribute("class", "buttonStyle1");
basicElem.setAttribute("onClick", "alert('ttt')");
The button is shown but neither "edit" works nor the style is honored.
I googled this and found out that one can create an element in IE this way:
basicElem = document.createElement("<input type='button' value='Edit' onClick=alert('ddd') class="buttonStyle1" />");
That DOES work but I would hate to resort to this "hack". Am I missing something in the original syntax? It works fine in Firefox, etc.
I'm trying to create a button with with document.createElement but IE refuses to work right.
Here's the code:
basicElem = document.createElement("INPUT");
basicElem.setAttribute("type", "button");
basicElem.setAttribute("value", "edit");
basicElem.setAttribute("class", "buttonStyle1");
basicElem.setAttribute("onClick", "alert('ttt')");
The button is shown but neither "edit" works nor the style is honored.
I googled this and found out that one can create an element in IE this way:
basicElem = document.createElement("<input type='button' value='Edit' onClick=alert('ddd') class="buttonStyle1" />");
That DOES work but I would hate to resort to this "hack". Am I missing something in the original syntax? It works fine in Firefox, etc.