Monaca Onsen UI Discord Chat Github Repo

alerts ons-switch giving undefined

  • Every time when i click the button i am getting checked as undefined…

    <ons-list modifier="inset" class="settings-list">        
           <ons-list-item >
             <span class="trn" data-trn-key="enabled_push_notification">Restaurant ON/OFF</span>
             <ons-switch var="s"  modifier="list-item" onclick ="checking();"     ></ons-switch>

    My javascript function

    function checking(){

  • administrators

    That’s probably because you have var="s" instead of id="s". But there should have been an error in the console first, right?