动态创建的td对指定给它的onclick不响应 也不报错
怎么改
代码如下:
%><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr style="display:block " > <td
onclick="window.location.href='Products.asp?cid=<%=rss("cid")%>'"
onMouseOver="this.style.backgroundColor='#E9E9E9'"
onMouseOut="this.style.backgroundColor=''" width="100%" class="xian01" height="25" align="left" style="CURSOR: hand" onclick=showtb(<%=rss("cid")%>) title="<%=rss("name")%>" > <%if rss("parentid")=0 then %><%=style&aa%><% else %> - <%=style%><%end if %> <a href="Products.asp?cid=<%=rss("cid")%>" ><%=rss("name")%></a></tr>
<tr><td id=tbtype<%=rss("cid")%> style='display:<%=display%>' >
怎么改
代码如下:
%><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr style="display:block " > <td
onclick="window.location.href='Products.asp?cid=<%=rss("cid")%>'"
onMouseOver="this.style.backgroundColor='#E9E9E9'"
onMouseOut="this.style.backgroundColor=''" width="100%" class="xian01" height="25" align="left" style="CURSOR: hand" onclick=showtb(<%=rss("cid")%>) title="<%=rss("name")%>" > <%if rss("parentid")=0 then %><%=style&aa%><% else %> - <%=style%><%end if %> <a href="Products.asp?cid=<%=rss("cid")%>" ><%=rss("name")%></a></tr>
<tr><td id=tbtype<%=rss("cid")%> style='display:<%=display%>' >
<tr style="display:block " > <td
onclick="alert(1);return false;window.location.href='Products.asp?cid=1'"
><a href="Products.asp?cid=1" >1</a></tr></table>ONCLICK没问题,可以执行.是你其它部分的问题,自己检查一下.