我试图设置元素的颜色。但还没有成功。在这里,我也想在点击时运行 2 个函数(addXXX,setcolor)。
<div id="tweet">'.$tweet['text'].'</div>
<input type="radio" name="pos" value="POS"
onclick="addPOS(this.previousElementSibling.innerHTML+\' \');
$(#tweet).css(\'background-color\', \'red\');">
<span class="label label-success">Pos</span>
</input>
<input type="radio" name="pos" value="NON"
onclick="addNON(this.previousElementSibling.previousElementSibling.previousElementSibling.innerHTML+\' \');
$(#tweet).css(\'background-color\', \'blue\');">
<span class="label label-warning">Non</span></input>
<input type="radio" name="pos" value="NEG"
onclick="addNEG(this.previousElementSibling.previousElementSibling.previousElementSibling.previousElementSibling.previousElementSibling.innerHTML+\' \');
$(#tweet).css(\'background-color\', \'yellow\');">
<span class="label label-important">Neg</span>
</input>';