【发布时间】:2016-06-13 07:49:15
【问题描述】:
我有下拉选择菜单并想在 api 的请求参数中发送下拉选择的值。我的代码是...
<select class="form-control" id = "SelectionInput_reason">
<option name="careerType" value="type_1">Career</option>
<option name="examType" value="type_2">Exams</option>
</select>
getValue = function() {
var selectedValue = this.value;
var selectedText = this.options[this.selectedIndex].getAttribute('name');
alert(selectedValue);
alert(selectedText);
}
document.getElementById('SelectionInput_reason').addEventListener('change', getValue );
如果可能,请在 angularJS 中给出答案...
我怎样才能在变量中获取tinymceeditor的文本输入?
$scope.tinymceModel = 'Initial content';
$scope.getContent = function() {
console.log('Editor content:', $scope.tinymceModel);
};
$scope.setContent = function() {
$scope.tinymceModel = 'Time: ' + (new Date());
};
$scope.tinymceOptions = {
selector: 'textarea',
//plugins: 'link image code',
toolbar: ' bold italic | undo redo | alignleft aligncenter alignright | code'
};
HTML 是..
<div class="form-group">
<textarea ui-tinymce="tinymceOptions" id="jander" ng-model="tinymceModel" placeholder="Ask your question" class="form-control"></textarea>
</div>
【问题讨论】:
-
如果您希望我们在 Angular js 中给出答案,请发布您的代码,其中至少包含您的 Angular 控制器。
-
代码在控制器本身,它只是我需要的一个功能。
标签: javascript jquery angularjs drop-down-menu tinymce