JSFiddle - React, Tailwind, and code Playground

by Nate Armstrong

HTML

<span>now there is a span directly under the body tag</span>
<p>Hello World!</p>
<p class="foo">Another paragraph, but this one has a class.</p>
<p><span>This is a span inside a paragraph.</span></p>
<p id="bar">Paragraph with an id.
  <span class="foo">And this sentence is in a span.</span>
</p>

<p>
  <span class="check">unlike this one...which needs a body>p>span selector</span>
</p>

JavaScript

var count = 0; // keep track of the current step count
$("#bar")
  .css({
    "background": "yellow",
    "border": "1px solid black"
  })
  .animate({
      "width": "100px"
    }, {
      "duration": 6000,
      "step": function() {
        if (count++ == 200) {
          $(this).stop(true, true);
        }
      }
  });