How do I replace text in a span element using Jquery?

jirimail

New Member
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!\[code\]<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>\[/code\]\[code\]$("#percentchooser li").click(function () { var percentage = $(this).html(); $("#percentchooser li").removeClass("selectedpercentage"); $(this).addClass("selectedpercentage"); $("#percentageamount").html(percentage);});\[/code\]
 
Back
Top