我有两个不同的div和基于下拉选择如果是general-1 div show和general-2 div hide,如果选择No general-2 div show和general-1 div hide.
请使用angular js为我提供正确的解决方案,我的示例代码如下所示.
我是角度Js的新手,所以请为我提供简单的方法来解决这个功能,以便更多地达到这个代码.
<html>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<div class="col-md-12" style="padding:5px">
<div class="col-md-12">
<label class="label-head">Phd Guide</label>
<select name="phd_guide" class="form-control" required ng-model="myVar">
<option value="">---Choose Phd Guide---</option>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</div>
</div>
<div class="col-md-12" style="padding:5px" id="general-1" ng-hide="myVar">
<div class="col-md-3">
<label class="label-head">Guide since</label>
<input type="text" class="form-control" name="guide_since" placeholder="Guide Since" required>
</div>
<div class="col-md-3">
<label class="label-head">Present Phd Scholars</label>
<input type="text" class="form-control" name="phd_scholar" placeholder="Phd Scholar" required>
</div>
<div class="col-md-3">
<label …Run Code Online (Sandbox Code Playgroud)angularjs ×1