title: Increase the size of flex item on button click
body: <p>I want to add a feature such that when I click the <code>flex-item</code> it must expand to size of complete row below it. Like basically increase it's size when I click on it, and get back to previous size when I click it again. </p>
  
  <p>The subsequent <code>elements</code> must remain of same size and be shifted to next row after the expanded clicked <code>flex-item</code> and follow the same properties of <code>flex-box</code>. The <code>flex-items</code> must be clickable <code>elements</code> which expand on click and get back to same size on another click.</p>
  
  <p>I am not able to figure this out and I am new to front-end technologies.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$('#clickMe').click(function() {
      $('#Demosss').append($('&lt;li id="flx-item" class="flex-item"&gt;').text('dar'));
      $(this).insertAfter($('[class^="flex-item"]').last());
  });</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.flex-container {
      padding: 0;
      margin: 0;
      list-style: none;
      -webkit-flex-direction: row; /* Safari */
      flex-direction:  row;
      flex-wrap:  wrap;
  }
  .flex-item {
      background: tomato;
      padding: 5px;
      width: 200px;
      height: 150px;
      margin-top: 10px;
      margin-right: 15px;
      line-height: 150px;
      color: white;
      font-weight: bold;
      font-size: 3em;
      text-align: center;
      display: inline-block;
      
  }
  ul li{
    display: inline;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;ul id="Demosss" class="flex-container"&gt;
  &lt;!-- add LI here --&gt;
  &lt;/ul&gt;
  
  
  &lt;button id="clickMe"&gt;Click Me&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>