Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.



<div ng-app="myApp" class="app">
  <h1>2014 Official Top Cat Election</h1>
  <div ng-controller="catCtrl">
       <!-- Badge start -->
       <tr ng-repeat="cat in cats" class="candidate">

         <td class="theradio">
          <input type=radio name=topcat value="{{}}">
         <td class="thebadge">
           <div class="candidate-badge"> 
             <img ng-src={{cat.img}}>
               <p><a ng-href="{{}}">See full biography</a></p>
    <!-- badge end -->
     <input type=submit value="Elect the 2014 Top Cat" class="btn btn-primary btn-lg" ng-click="trickyVote()">
    <div id="messages" class="alert alert-success" ><span><img src=""></span>{{voter.message}}</div>
    <div class="votetable">
      <table class="table table-striped table-bordered table-hover">
        <tr ng-repeat="vote in votes">



                .app {
  padding-left: 1em;

.candidate-badge {
  margin-left: 1.5em;
tr.candidate {
  margin: 2em;

  margin-bottom: 2em;
  padding-top: 1em;
  clear: left;
  overflow: auto;
tr.candidate input {
  valign: middle;
tr.candidate label {
  font-size: 120%;
  font-weight: bold;
  padding-left: 1em;
tr.candidate img {
  float: left;
  clear: right;
  max-width: 150px;
  padding-right: 1em;
  padding-bottom: 1em;
td.theradio {
  xxx-background: #acacac;
  padding: 1em;
td.thebadge {
  border: 1px #ababab dotted;
td.theradio input[type="radio"] {
  border: 1px red solid;
  background: red;
.hilite {
  background: #99dd99;
.votetable table td {
  xx-padding: 1em;
.votetable {
  margin-top: 1em;
  width: 70%;
table {
  margin-bottom: 1em;
div#messages {
  display: none;
  margin: 1em;
#messages span {
  margin-right: 1em;



                $("document.ready", function() {
  $("input[type=radio]").on("click", function() {
  $("tr").on("click", function() {
    $(this).find('input[type=radio]').prop("checked", true);

var app = angular.module('myApp',[]);
app.controller("catCtrl", function($scope) {
  $scope.votes = [
    {name: 'Bossy Lynn', votes: 23},
    {name: 'Sherman LeGrande', votes: 0},
    {name: 'Seamus McGraw', votes: 0},
    {name: 'the Weasel', votes: 0}
  $scope.voter = {
  $scope.trickyVote = function() {
    angular.element("tr:first input[type=radio]").prop("checked", true);
    $scope.voter.message="Thanks for voting for Bossy! Every vote counts.";
    //alert("Thanks for voting for Bossy, every vote counts.");
    $scope.votes[0].votes += 1;
    //$scope.voter.showAlert = 1;
    setTimeout(function() {
      // wrap in a $scope.$apply
      $scope.$apply(function() {
        //$scope.voter.message = "";
    }, 5000);
  $scope.cats = [
    {id: 1, name: 'Bossy Lynn', img: '', desc: 'Bossy would make a great Top cat as she has extensive experience making executive decisions.',
    {id: 2, name: 'Seamus McGraw', img: '', desc: 'Seamus would prefer you let him outside for a while and you voted for someone else, except perhaps for bossy.', link:''},
    {id: 3, name: 'Sherman LeGrande', img: '', desc: 'Sherman is a good choice as he has great people skills.', link:''},
    {id: 4, name: 'the Weasel', img: '', desc: 'wat?!', link:''}