Jump to content

tgupta@fidelia.com

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by tgupta@fidelia.com

  1. Hi    I hava prepaired a select box using Dom. But when I am firing a onClick event on Firefox it is working fine. The same code is not working on IE 6.0.

    Hi here is the code:
    <HTML><head><script language="javascript">function addRow(){	var selectBox = document.createElement("select");	selectBox.setAttribute("id", "selectBox");	selectBox.setAttribute("onChange", "alert(\'Hello God\')");		var optionOne = document.createElement("option");	var txt1 = document.createTextNode("One");	optionOne.appendChild(txt1);	var optionTwo = document.createElement("option");	var txt2 = document.createTextNode("Two");	optionTwo.appendChild(txt2);	var optionThree = document.createElement("option");	var txt3 = document.createTextNode("Three");	optionThree.appendChild(txt3);	selectBox.appendChild(optionOne);	selectBox.appendChild(optionTwo);	selectBox.appendChild(optionThree);	var customTr = document.createElement("tr");	var customTd = document.createElement("td");	customTd.appendChild(selectBox);	customTr.appendChild(customTd);	var trNode = document.getElementById("tr1");	var tableNode = trNode.parentNode;	tableNode.insertBefore(customTr,trNode);}</script></head><BODY><form><table id="table" border="1"><tr id="tr1"><td><input type="button" id="button1" value="Add Select Box" onClick="addRow()"></td></tr></table></form></BODY></HTML>

×
×
  • Create New...