如何在容器中显示html链接? [英] How to display a html link in container?

查看:65
本文介绍了如何在容器中显示html链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个文件中有四条记录,其中一条包含类似< a href =" http://steelers.com"> Pittsburgh Steelers< / a>的链接再次赢了。


我正在读取记录并将它们存储在一个名为div1的容器中问题是我希望上面的Pittsburgh Steelers字样在添加时显示为实际链接到div1。现在链接显示就像它在文件中一样。我使用的是javascript和innerHTML。


四条记录被附加到一个名为dataIN的变量中。然后最后一个语句是document.getElementByID(''div1'')。innerhtml + = dataIN。


我想存储 Pittsburgh Steelers 再次在容器中获胜而不是实际文本版本

< a href =" http://steelers.com" > Pittsburgh Steelers< / a>再次获胜

I have four records in a file and one of them contains a link like <a href = "http://steelers.com">Pittsburgh Steelers</a> win again.

I am reading the records and storing them in a container called div1 The problem is that I want the Pittsburgh Steelers words above to show up as an actual link when they are added to the div1. Right now the link is showing up just like it is in the file. I am using javascript and innerHTML.

The four records are appended to a variable called dataIN. Then the last statement is document.getElementByID(''div1'').innerhtml += dataIN.

I want to store Pittsburgh Steelers win again in the container instead of actual text version
<a href = "http://steelers.com">Pittsburgh Steelers</a> win again

推荐答案

对我来说很好。
Works fine for me.
< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


是的,我自己可以轻松地这样做。我做到了。问题是< a href =''http://steelers.com''> Pittsburgh Steelers< / a>再次获胜" ;;

在文件中。

Yes I can easily do it that way myself. I have done that. The problem is that the <a href = ''http://steelers.com''>Pittsburgh Steelers</a> win again";
is inside a file.

展开 | 选择 | Wrap | 行号


这是iframe和div

Here is the iframe and div

展开 | 选择 | Wrap | 行号


这篇关于如何在容器中显示html链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆