答案 0 :(得分:0)
您需要从事件中获取值,如下所示:
mydropdown.onchange = function(e){
mytextbox.value = mytextbox.value + e.value;
}
答案 1 :(得分:0)
访问下拉元素值使用此
mydropdown.options[mydropdown.selectedIndex].value;
当您连接到文本区域时,为良好视图添加空格
mytextbox.value = mytextbox.value +' '+ mydropdownValue;
查看代码
var mytextbox = document.getElementById('message');
var mydropdown = document.getElementById('dropdown');
mydropdown.onchange = function() {
var mydropdownValue = mydropdown.options[mydropdown.selectedIndex].value;
mytextbox.value = mytextbox.value + ' ' + mydropdownValue;
}

My Code:
<div text-angular="text-angular" name="htmlcontent" ng-model="htmlcontent" ta-disabled='disabled'></div>
<p>
<textarea type="text" id="message" ng-model="htmlcontent" required="required" style="display: block;" name="message" required /></textarea>
</p>
</div>
HTML JSFIDDLE:
<select id="dropdown">
<option value="">None</option>
<option value="text1">text1</option>
<option value="text2">text2</option>
<option value="text3">text3</option>
<option value="text4">text4</option>
</select>
&#13;
答案 2 :(得分:0)
var text = document.getElementById('message');
var drop = document.getElementById('dropdown');
drop.addEventListener('change',function(e){
text.value += ' ' + e.target.value;
//OR ` ${e.target.value}`
})
<div text-angular="text-angular" name="htmlcontent" ng-model="htmlcontent" ta-disabled='disabled'></div>
<p>
<textarea type="text" id="message" ng-model="htmlcontent" required="required" style="display: block;" name="message" required /></textarea>
</p>
</div>
<select id="dropdown">
<option value="">None</option>
<option value="text1">text1</option>
<option value="text2">text2</option>
<option value="text3">text3</option>
<option value="text4">text4</option>
</select>