<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);
}
}
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.