Home > Web Front-end > HTML Tutorial > outerHTML创建文本框通过id获取不到值,why?_html/css_WEB-ITnose

outerHTML创建文本框通过id获取不到值,why?_html/css_WEB-ITnose

WBOY
Release: 2016-06-21 09:03:44
Original
1038 people have browsed it




String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>

nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


">

My JSP 'allteasort.jsp' starting page

<script> <br />var xmlhttp; <br />var spaninnerhtml; <br />var x; <br />var id; <br />function getIE(){ <br /> if(window.XMLHttpRequest){ <br /> xmlhttp=new XMLHttpRequest(); <br /> } <br /> else{ <br /> xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); <br /> } <br /> <br /> <br /> <br />} <br />function getChange(obj){ <br /> <br /> <!--为什么我通过$(x+'n').value获取不到值呢?--> <br /> <br />} <br />function getBack(){ <br /> <br />} <br /> <br /> <br />function tdnchange(obj){ <br /> x = obj; <br /> spaninnerhtml =$(x).innerHTML; <br /> id=x+'n'; <br /> document.getElementById(x).outerHTML="<input id='"+x+'n'+"' type='text' value='"+spaninnerhtml+"' ondblclick='"+getChange(obj)+"'/>"; <br /> <br /> $(x+'n').focus(); <br />} <br />function $(id){ <br /> return document.getElementById(id); <br />} <br /> <br /></script>

















茶叶类别id

茶叶类别名称

${temp.tsid} 

${temp.tsname}





回复讨论(解决方案)

document.getElementById(x).outerHTML="";

id有误,看1楼框得还蛮准的,给1楼好了

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template