Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <h1> Calculate Your Cost Saving when using Froala instead of TinyMCE</h1>
<div>
<label>Enter the expected additional Editor Loads number </label><br/>
<input type="number" id="loads" value='30000' placeholder="Enter additional page loads" >
</div>
<br/>

<button type="submit" value="Calculate" id='calculate'>Calculate</button>
<div>
   <table width="100%">
  <tr>
    <th>TinyMCE Plan</th>
    <th>Froala Plan</th>
    <th>Cost Saving value/month ($)</th>
    <th>Cost Saving (%)</th>
  </tr>
            <tr>
    <td>Profissional</td>
    <td>Enterprise</td>
    <td id='pro1val'>-</td>
    <td id='pro1'>-</td>
  </tr>
     
            <tr>
    <td>Essential</td>
    <td>Enterprise</td>
    <td id='ess1val'>-</td>
    <td id='ess1'>-</td>
  </tr>
     <tr>
    <td>Free</td>
    <td>Enterprise</td>
    <td id='free1val'>-</td>
    <td id='free1'>-</td>
  </tr>
  <tr>
    <td>Profissional</td>
    <td>Profissional</td>
    <td id='pro2val'>-</td>
    <td id='pro2'>-</td>
  </tr>
       <tr>
    <td>Essential</td>
    <td>Profissional</td>
    <td id='ess2val'>-</td>
    <td id='ess2'>-</td>
  </tr>
       <tr>
    <td>Free</td>
    <td>Profissional</td>
    <td id='free2val'>-</td>
    <td id='free2'>-</td>
  </tr>
</table> 
</div>
              
            
!

CSS

              
                th{
  text-align: left
}
              
            
!

JS

              
                function calculate(){
  let additiona_loads = $('#loads').val();
let 
tinyFree = 0,
tinyEss = 67,
tinyPro = 130,
froPro =75,
froEnt = 167;

if(additiona_loads > 1000){
      
   tinyFree += (((additiona_loads - 1000)/1000) * 40);
     
 }
  
 if(additiona_loads > 5000 ){  
   tinyEss += (((additiona_loads - 5000)/1000) * 40);
      
  }
  
if(additiona_loads > 20000){
   tinyPro += (((additiona_loads - 20000)/1000) * 40);     
}

  //Free
    let free2val = Math.round(tinyFree - froPro) ;
  let free2 = Math.round(free2val/froPro * 100) ;
  $('#free2val').text('$'+free2val ) ;
  $('#free2').text(free2+'%' ) ;

  let free1val = Math.round(tinyFree - froEnt);
  let free1 = Math.round(free1val/froEnt * 100) ;
  $('#free1val').text('$'+free1val ) ;
  $('#free1').text(free1+'%' ) ;
  
    //ess
    let ess2val = Math.round(tinyEss - froPro) ;
  let ess2 = Math.round(ess2val/froPro * 100) ;
  $('#ess2val').text('$'+ess2val ) ;
  $('#ess2').text(ess2+'%' ) ;

  let ess1val = Math.round(tinyEss - froEnt);
  let ess1 = Math.round(ess1val/froEnt * 100) ;
  $('#ess1val').text('$'+ess1val ) ;
  $('#ess1').text(ess1+'%' ) ;
  
  // Pro
  let pro2val = Math.round(tinyPro - froPro) ;
  let pro2 = Math.round(pro2val/froPro * 100) ;
  $('#pro2val').text('$'+pro2val ) ;
  $('#pro2').text(pro2+'%' ) ;

  let pro1val = Math.round(tinyPro - froEnt);
  let pro1 = Math.round(pro1val/froEnt * 100) ;
  $('#pro1val').text('$'+pro1val ) ;
  $('#pro1').text(pro1+'%' ) ;
  


}

$(document).ready(function(){
  calculate();
    $(document).on('click','#calculate', function(){
        calculate();
    });
});
              
            
!
999px

Console