I have a toggle button with by default value="1" = on offer.Now, with my jQuery, I can change this value to 0, for on request.But, after that, if I want to change it back to value 1, it s blocked with value="0".How can I do to make this revert to my value by default?
function change() {
  var elem = document.getElementById("home-header_on_offer");
  if (elem.value == "1") 
    elem.value = "0";
  else if (elem.value = "0") 
    elem.value = "1";
}<label class="label" style="right: -20px;position: relative">On offer</label>
<label class="switchCr">
  <input onclick="change()" type="checkbox" name="custom7" value="1" id="home-header_on_offer"
checked="checked">
  <span class="sliderCr round select" id="my-career-search-header" style="border-radius: 0px;top: -52px;width: 255px;height: 33px;border-width: 1px;border-color:  #bbb;position: relative;box-shadow: none;"onclick="myFunction2()"></span>
</label> 
     
     
     
     
    