我们如何在文本框中的textarea中插入超链接 [英] How we insert hyperlink in textarea in textbox

查看:2176
本文介绍了我们如何在文本框中的textarea中插入超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <   textarea  >  
这用于暗示您有待处理的请求。
批准此点击以下链接
< a href = < a rel = nofollow href = < span class =code-keyword> http:// localhost:8080 / travel / t_form.jsp 目标 = _ blank > http:// localhost:8080 / travel / t_form.jsp < / a < span class =code-keyword>> < / textarea >

解决方案

你不能那样做。因为您只能将文本放在textarea中,所以不允许使用活动的HTML标记。如果你想要一个带有活动链接的简单文本,那么使用div作为文本区域。


请参阅我的评论:在你的HTML中,所有代码都在你的里面textarea 元素。这是错的。此元素旨在允许用户输入纯文本。其文本中的所有HTML代码都不会呈现为HTML,也不应该呈现。这不仅是不可能的,也没有任何意义。如果你需要一个超链接(通过锚元素呈现),将它放在 textarea 元素之外。



-SA

<textarea>
this is used to intimate you that you have a request pending.
to approve this click the following link
<a href=<a rel="nofollow" href="http://localhost:8080/travel/t_form.jsp" target="_blank">http://localhost:8080/travel/t_form.jsp</a></textarea>

解决方案

You cannot do that. Because you can only put text inside the textarea and active HTML tags are not allowed. If you want a simple text with active links, then use a div as your text area.


Please see my comment: in your HTML, all code is insider your textarea element. This is wrong. This elements is designed to allow the user to enter plain text. All HTML code inside its text is not rendered as HTML and is not supposed to be. Not only it is impossible, it would not make any sense. If you need a hyperlink (rendered via anchor element), place it outside of textarea element.

—SA


这篇关于我们如何在文本框中的textarea中插入超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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