Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body ng-app="">
My favorite topic is:
<select ng-model="myVar">
  <option value="dogs">Dogs
  <option value="tuts">Tutorials
  <option value="cars">Cars
</select>
<hr>
<div ng-switch="myVar">
  <div ng-switch-when="dogs">
     <h1>Dogs</h1>
     <p>Welcome to a world of dogs.</p>
  </div>
  <div ng-switch-when="tuts">
     <h1>Tutorials</h1>
     <p>Learn from examples.</p>
  </div>
  <div ng-switch-when="cars">
     <h1>Cars</h1>
     <p>Read about cars.</p>
  </div>
  <div ng-switch-default>
     <h1>Switch</h1>
     <p>Select topic from the dropdown, to switch the content of this DIV.</p>
  </div>
</div>
<hr>
<p>The ng-switch directive hides and shows HTML sections depending on a certain value.</p>
</body>
</html>