I'm trying to get the #percent amount to change to the text contained in the li that is clicked. Someone help me fix my code please and thanks!
<div id="percentchooser">
<ul>
<li>25</li>
<li>30</li>
<li class="selectedpercentage">35</li>
<li>40</li>
<li>45</li>
<li>50</li>
</ul>
<div id="percentage"><span id="percentamount">35</span><span id="percentsign">%</span>
</div>
$("#percentchooser li").click(function () {
var percentage = $(this).html();
$("#percentchooser li").removeClass("selectedpercentage");
$(this).addClass("selectedpercentage");
$("#percentageamount").html(percentage);
});
.text(): api.jquery.com/text/#text2