c# - 将 href 设置为超链接文本

标签 c# javascript html

我从数据库中获取以下文本,href 为 null。

You also have to click on this link .

我在页面加载时分配给标签的文本。 我的要求是当我点击“链接”时我需要重定向到特定页面。我应该在哪里分配 href 值以及如何分配?

最佳答案

<script>
var s = document.getElementByTagName("a");
s.href = ""; // here give the href value
</script>

关于c# - 将 href 设置为超链接文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14049867/

相关文章:

c# - Controller 和 IDisposable

javascript - 在 Azure 移动服务 Javascript SDK 中使用 $expand 查询

jquery - 使用 JQuery slideToggle 显示不同的表单

javascript - 捕获 <webview> 中由 HTML 标签引起的 "Failed to load resources"错误

c# - 使用Java上传文件

c# - WCF WebInvoke JSON 反序列化失败 - 400 错误请求

c# - 使用命令行禁用 FIPS

javascript - jQuery:如何在表单提交时使用修改键?

javascript 意外的非法 token

html - 链接悬停时的动画图标