JavaScript动态创建元素
我的页面上有这样一个元素
JScript code:
<div>
产品类别:<input type="text" name="productType" /><br />
产品图片:<input type="text" name="productImg" /><br />
产品名称:<input type="text" name="productName" /><br />
产品说明:<textarea rows="10" cols="50" name="productIntroduce"></textarea>
</div>
有一个按钮,点击它的时候调用JavaScript,创建一个层,层里包含上述代码所示的所有表单元素。该如何实现呢?
innerHTML
HTML code:
<div id="productDiv" style="display: none;">
产品类别:<input type="text" name="productType" /><br />
产品图片:<input type="text" name="productImg" /><br />
产品名称:<input type="text" name="productName" /><br />
产品说明:<textarea rows="10" cols="50" name="productIntroduce"></textarea>
</div>
<input type="button" value="查看" onClick="showProductDiv();" >
<script type="text/JavaScript"
相关问答:
这是我的文本框
<input type="text" size="60" name="password_answer" id="pwdanswer" value="$!password_answer" >
提交按钮
<input clas ......
用javascript加载页面时指向一个描点。已知如何通过链接做成描点的,可是想让页面加载时直接指向不需要点击链接。
1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &quo ......
我也来一个趣味javascript:
打开以下html文件,依次按下G,L,C三个键,就会有奇迹出现!!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" ......
<html>
<head>
<script>
var a=prompt("请输入一个数");
if(a==0)
{alert("不是质数");}
else
{while((a%2)*(a%3)*(a%5)*(a%7)==0)
{alert("不是质数");br ......
我的jsp是utf-8,我的js文件怎样转为utf-8我现在用的是Dreamweaver cs3 我在jsp引入js时就不行。。
还有大家是用什么来编辑js的。 调试呢
vs2008,eclipse
我用myeclipse更新装spket和jseclipse但是最后报错。浪 ......