<div id="dvHTML"></div>
<form name="form1">
<input type="text" name="txtLink" value="csdn">
<input type="text" name="txtURL" value="http://www.csdn.net"><br>
<input type="button" value="create link with js" onclick="javacript:createLink(this.form.txtLink.value, this.form.txtURL.value)">
<input type="button" value="create link with vbs" onclick="vbscript:call createLink2(me.form.txtLink.value, me.form.txtURL.value)"></form>
<script language="javascript">
function createLink(txt,url)
{
var a = document.createElement("A");
a.href = url;
a.innerHTML = txt;
document.getElementById("dvHTML").appendChild(a);
}
</script>
<script language="vbscript">
sub createLink2(txt,url)
dim a
set a = document.createElement("A")
a.href = url
a.innerHTML = txt
document.getElementById("dvHTML").appendChild(a)
end sub
</script>
<form name="form1">
<input type="text" name="txtLink" value="csdn">
<input type="text" name="txtURL" value="http://www.csdn.net"><br>
<input type="button" value="create link with js" onclick="javacript:createLink(this.form.txtLink.value, this.form.txtURL.value)">
<input type="button" value="create link with vbs" onclick="vbscript:call createLink2(me.form.txtLink.value, me.form.txtURL.value)"></form>
<script language="javascript">
function createLink(txt,url)
{
var a = document.createElement("A");
a.href = url;
a.innerHTML = txt;
document.getElementById("dvHTML").appendChild(a);
}
</script>
<script language="vbscript">
sub createLink2(txt,url)
dim a
set a = document.createElement("A")
a.href = url
a.innerHTML = txt
document.getElementById("dvHTML").appendChild(a)
end sub
</script>
解决方案 »
- 关于jquery animate 函数的一个问题
- 有人用过Ext.ux.ImageButton 没?
- 图片滚动
- 我用onMouseOver="this.style.backgroundColor='#1b1e89'" 实现鼠标移动改变背景颜色,为什么...
- 在IE7里正常.在IE6中显示说Marquee未定义
- 新手,提问:在XP系统中能不能大搭建WEB服务器,需要安装什么软件?
- jqGrid 分页总页数不显示
- 表单验证的奇怪问题?
- 关于Server-side Scriptlet的使用。(创建脚本失败?)
- 在客户端怎样用javascript检测某个文件是否存在??急!!!!
- 这个函数怎么写?-----在线急等
- textarea中光标在一个随意位置,javascript有什么办法能在光标后面加上自己定义的字符
my website:http://cutepig.9126.com or http://sdhe.9126.com
转换为
my website:<a href=http://cutepig.9126.com>http://cutepig.9126.com</a> or <a href=http://sdhe.9126.com>http://sdhe.9126.com</a>
多谢了。主要是算法的问题。