Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
爱奥尼亚/javascript:带<;a>;标签可以';不能在HTML中单击_Javascript_Css_Ionic Framework_Hyperlink - Fatal编程技术网

爱奥尼亚/javascript:带<;a>;标签可以';不能在HTML中单击

爱奥尼亚/javascript:带<;a>;标签可以';不能在HTML中单击,javascript,css,ionic-framework,hyperlink,Javascript,Css,Ionic Framework,Hyperlink,我有一个包含标记的文本,但是当我在标记中显示它时,它不能被点击 例如,这是文本的变量: var str="Hi <a href='www.google.com'>Google</a> !!!"; var str=“嗨!!!”; 我用这种方式显示它,但链接仍然显示为文本 <p> {{str}} </p> {{str}} 输出:嗨谷歌 我找到了解决方案,就像这样: <p [innerHtml]="str"></p&g

我有一个包含标记的文本,但是当我在标记中显示它时,它不能被点击

例如,这是文本的变量:

var str="Hi <a href='www.google.com'>Google</a> !!!";
var str=“嗨!!!”;
我用这种方式显示它,但链接仍然显示为文本

<p>
   {{str}}
</p>

{{str}}

输出:嗨
谷歌


我找到了解决方案,就像这样:

<p [innerHtml]="str"></p>