<分区>
这听起来像是一个很容易解决的问题。不可否认,我曾希望能够做到这一点。我想要一根绳子,有两种颜色。在 JS 中:
function twoColors(s1,s2) {
s1.color = "#hexColor1";
s2.color = "#hexColor2";
return(s1+s2)
}
在 HTML 中(在 JS 中采购之后)
<script>
document.getElementById("theElementsID").innerHTML = twoColors("one","two");
</script>
然而这行不通... 想法?