function getEntry(time)
{
var newdiv = document.createElement("div");
if(time=='120')
{
var container = document.getElementById('require');
newdiv.innerHTML = "<tr id='a'><td><input type='radio' name='type' value='001' onchange='getRadioCheckedValue();' checked>Resume Writing<input type='hidden' name='service' id='1_59.95' value='Resume Writing'> </td><td><input type='hidden' name='price' value='59.95'>$59.95</td></tr>";
container.appendChild(newdiv);
}
我在瀏覽器上什麼都沒有得到,當我運行這個功能時......它在Firefox中正常工作,但是在IE上卻發生了......沒有錯誤。javascript和IExplorer
有人可以請explin如何解決這個問題。
謝謝。
你的newdiv是一個div元素,你想插入表中的行。 IE對XHTML非常嚴格。你應該創建一個表(帶有tbody可選)並將你的行添加到它。 如果這也不起作用,那麼你可以創建像tr,td和輸入的所有子元素,並且可以將它附加到table,tbody,tr和td。 – 2010-11-22 09:02:24