我如何用js编写,以便在选择时自动将以下内容添加到消息字段中:[b]★★★★★[/b]
<select id="Rating" onchange="myFunction()">
<option>შეფასება</option>
<option>★★★★★</option>
<option>★★★★</option>
<option>★★★</option>
<option>★★</option>
<option>★</option>
</select>
<script>
function myFunction() {
var mylist = document.getElementById("Rating");
document.getElementById("message").value = mylist.options[mylist.selectedIndex].text;
}
</script>
比如像这样...