Javascript 通过JS编码的HTML文本不呈现
我有一对三角形,我想包含在一个设计中,它要求文本通过JS文件显示,但JS中的HTML编码文本无法呈现。有人知道怎么做吗 谢谢你抽出时间Javascript 通过JS编码的HTML文本不呈现,javascript,html,Javascript,Html,我有一对三角形,我想包含在一个设计中,它要求文本通过JS文件显示,但JS中的HTML编码文本无法呈现。有人知道怎么做吗 谢谢你抽出时间 具体内容如下: 网站▴ 网站▾ 以下是JS: (最后一行是:网站和#9652网站和#9662) 改变 到 .text()函数是HTML转义的(再次)。另外,它不需要函数。是否将其更改为$header.html(function(){…帮助? $(function() { $(".header").click(function () { $head
具体内容如下: 网站▴ 网站▾ 以下是JS:
(最后一行是:网站和#9652网站和#9662) 改变 到
.text()
函数是HTML转义的(再次)。另外,它不需要函数。是否将其更改为$header.html(function(){…
帮助?
$(function() {
$(".header").click(function () {
$header = $(this);
//getting the next element
$content = $header.next();
//open up the content needed - toggle the slide- if visible, slide up, if not slidedown.
$content.slideToggle(500, function () {
//execute this after slideToggle is done
//change text of header based on visibility of content div
$header.text(function () {
//change text based on condition
return $content.is(":visible") ? "Websites ▴" : "Websites ▾";
});
});
});
});
$header.text(function () {
//change text based on condition
return $content.is(":visible") ? "Websites ▴" : "Websites ▾";
});
$header.html($content.is(":visible") ? "Websites ▴" : "Websites ▾");