我目前正在使用以下標記,該標記呈現爲僅帶有圖標的按鈕。
我希望這是圖標後跟Export PDF
這個詞。Html改變文本的<a>標記
通常,我不會去創建像這樣的按鈕,但我正在使用一個Kendo控件來爲我生成按鈕。一旦呈現的按鈕看起來如下:
<a href="" role="button" class="k-tool k-group-start k-group-end"
unselectable="on" title="Export PDF">
<span unselectable="on" class="k-tool-icon k-pdf"></span>
<span class="k-tool-text">Export PDF</span>
</a>
我試圖使用jQuery我想要的文字注入元素如下:
<script>
$(document).ready(function() {
$('.k-tool-icon').text("Export PDF");
});
</script>
但是這不會改變任何東西。我仍然只有一個圖標的按鈕。
編輯:下面是渲染上面貼HTML的C#MVC劍道編輯:
@(Html.Kendo().Editor()
.Name("editor")
.HtmlAttributes(new { style = "height:900px" })
.Pdf(pdf => pdf
.Margin(20, 20, 20, 20)
.ProxyURL(Url.Action("Pdf_Export_Save", "Editor"))
)
.Tools(tools => tools
.Clear()
.Pdf()
)
.Value(@<text>
<code>
@Html.Raw(HttpUtility.HtmlDecode(Model.ReportString))
</code>
</text>)
)
適用於我https://jsfiddle.net/j08691/f0pcyx1q/ – j08691
該圖標可能使用文本替換技術。設計.k-tool-text span文件有什麼問題? – moopet
@ j08691因爲你實際上沒有使用劍道編輯器,所以它可能適合你?我不確定。然而,它絕對不適合我 – GregH