Search code examples
javascriptjqueryautonumeric.js

Jquery autoNumeric set a label


I want to set the value of a label with autoNumeric but it is not setting the value I tried it like this

$('#lblTotal').autoNumeric(data.total);

but it is not setting the value anyOne used it ???


Solution

  • This is how I should have set the value with autoNumeric but I was not calling 'init'

    $('#lblTotal').autoNumeric('init');
    $('#lblTotal').autoNumeric('set', data.total);
    

    To get value with autoNumeric

    $('#lblTotal').autoNumeric('get');