Prepend Text in Form Input Texbox

Synopsis:
I’m trying to add a dollar sign ($) before I text box by using jQuery’s prepend. But I’m not getting any results.

<script type="text/javascript">
    $("document").ready(function() {
    $("#Total").prepend("$");
        
    });

<input type="text" class="totalnumber rsform-input-box" ;="" readonly="readonly" id="Total" name="form[Total]" size="20" value="0.00">

Result is:
0.00 (no dollar sign)

If I use:

$("#Total").val("$");

Then it just does this:
$ with no value with it.

Can someone educate me on the right way to prepend a dollar sign before a value?

$('#Total').val('$' + $('#Total').val());

HTH,

:slight_smile:

Sweet. Thank you, WolfShade!

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.