<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>
解决方案 »
- lightbox需要动态加载的内容 求助
- 急等,如何找出两个字符串的不同之处?急急急...
- 谁有javascript好的学习资料,推荐给我一下.
- 请问用PHOTOSHOP的套索工具绘出图形后怎么填充颜色 啊
- javascript如何使用xPath?
- 这个功能如何实现,求各位大哥帮忙?
- 用过innerHTML的朋友帮帮忙,<TR>现实异常,变成NAN了
- 请教JS高手
- 有没有好的办法,使任何阻止弹出窗口的工具都失效
- 请问那里有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>
多谢了。主要是算法的问题。