Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ 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

Save Automatically?

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

              
                <h3>&#12304;Dark Summoner&#12305; Monster Leveling Cost</h3><form id="monsterLevelCost" class="clearfix"> <input type="number" id="monsterLevel" placeholder="Monster Level" autocomplete="off" onkeypress="return isNumberKey(event)" min="1" max="299" /> <input type="number" id="monsterSac" placeholder="# Monsters To Sac" autocomplete="off" onkeypress="return isNumberKey(event)" min="1" max="10" /> <input type="button" value="Go" onclick="monsterLevelCalc()" /></form><div id="goldCost"></div><p></p><div>Designed by LordTubington<br />Guild: Rancor<br />Player ID: 2078249623</div>
              
            
!

CSS

              
                body {
  background:#fff;
}
input[type="number"] {
  min-width: 200px;
}
#goldCost {
  padding: 10px 0 10px 0;
}
              
            
!

JS

              
                function isNumberKey(b){var a=(b.which)?b.which:event.keyCode;if(a>31&&(a<48||a>57)){return false}return true}function monsterLevelCalc(){var c,a,b;c=document.getElementById("monsterLevel").value;a=document.getElementById("monsterSac").value;b=0;if(c===null||c===""||a===null||a===""){document.getElementById("goldCost").innerHTML="<span style='color:red;'>Please fill out Monster Level and # of Monsters to Sac</span>";return false}else{if(a>10){document.getElementById("goldCost").innerHTML="<span style='color:red;'># of Monsters to Sac should be no greater than 10</span>";return false}else{if(c>299){document.getElementById("goldCost").innerHTML="<span style='color:red;'>Monster Level should be no greater than 299</span>";return false}}}c*=1;a*=1;b=-5*(c+1)*(a-21)*(a);document.getElementById("goldCost").innerHTML="The cost is <span style='color:#ffbf00;font-weight:700;'>$"+b+"</span> gold."};
              
            
!
999px

Console