Code not working on iphone/Safari

Hi,

The code works fine on desktop, galaxy, chrome. For some reason when testing the site on an iPhone, the code below does not work. Any ideas on what is going on/wrong?

$w . onReady ( function () {
$w ( ‘#input247’ ). onChange (( Event ) => {
const salesPrice = Math . trunc ( Number ( $w ( ‘#input247’ ). value )) ;
const stdCommission = Math . round ( salesPrice * 0.06 );
const ourCommission = Math . round ( salesPrice * 0.025 );
const savings = stdCommission - ourCommission ;

    $w ( '#input247' ). value  =  **null** ; 

    $w ( "#text548" ). text  =  '$'  +  salesPrice . toLocaleString (); 
    $w ( "#text549" ). text  =  '$'  +  stdCommission . toLocaleString (); 
    $w ( "#text550" ). text  =  '$'  +  ourCommission . toLocaleString (); 
    $w ( "#text551" ). text  =  '$'  +  savings . toLocaleString (); 
     })  

});

Screenshot …

Safari might not work with some functions like Math or what, can you use console log to find out when the code is stopped?

Ok. I’ll check it out.

It worked once and then won’t work again. I will advise after I review console log. Thanks.