title: Enable/disable zoom on iPhone safari with Javascript?
body: <p>I have 1 page which has 2 DIV elements which is shown/hidden based on user click on action buttons with javascript, I would like to toggle scaling on action button click.</p>
  
  <p>I tried with below javascript and it is changing viewport meta but getting no effect.</p>
  
  <p>Any suggestions?</p>
  
  <pre><code>var ViewPortAllowZoom = 'width=device-width;';
  
  var ViewPortNoZoom = 'width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=no;';
  
    function AllowZoom(flag) {
              if (flag == true) {
                  $('meta[name*=viewport]').attr('content', ViewPortAllowZoom);                
              }
              else {
                  $('meta[name*=viewport]').attr('content', ViewPortNoZoom);
              }
          }
  </code></pre>