首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我要我的按钮标签上的文字

我要我的按钮标签上的文字
EN

Stack Overflow用户
提问于 2014-08-05 06:50:25
回答 2查看 26关注 0票数 0

下面提到的是我的按钮的代码

代码语言:javascript
运行
复制
<button type="button"  Value="End Test" class="testBtns" style="float:right;"onclick="location.href='@Url.Action("StudentResult", "Student", new {  TestId = ViewBag.TestId ,style="color:white"} )'" />

i am not getting the "End Text" text on my button anybody know then please help
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-08-05 06:53:50

试试这个;

代码语言:javascript
运行
复制
<button type="button"  class="testBtns" style="float:right;" onclick="location.href='@Url.Action("StudentResult", "Student", new {  TestId = ViewBag.TestId ,style="color:white"} )'" >End Test</button>

value属性指定<button><form>中的初始值,而不是显示文本。

票数 1
EN

Stack Overflow用户

发布于 2014-08-05 06:55:30

只需将按钮更正为:

代码语言:javascript
运行
复制
<button type="button"  class="testBtns" style="float:right;" onclick="location.href='@Url.Action("StudentResult", "Student", new {  TestId = ViewBag.TestId },new { @style="color:white" } )'">End Test</button>

您想要在按钮中显示的文本应该包含在button tag的开始标记和结束标记之间,并且只要更正@url.action,您就可以将object routehtml attributes混合在一起。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25132749

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档