I have this unordered list
- two
- three
Is there a way I can prepend to the
$("ul").prepend("<li>ONE</li>");
Something simple like this ought to work:
$("ul").prepend("<li>ONE</li>");
use prepend instread of append
<h2>Greetings</h2>
<div class="container">
<div class="inner">Hello</div>
<div class="inner">Goodbye</div>
</div>
$('.container').prepend('<p>Test</p>');
refer http://api.jquery.com/prepend/ for more info.