Difference between revisions of "Página de pruebas 2"

From Sinfronteras
Jump to: navigation, search
Line 59: Line 59:
 
<script src="http://perso.sinfronteras.ws/1-archivos/prism.js"  type="text/javascript"> </script>
 
<script src="http://perso.sinfronteras.ws/1-archivos/prism.js"  type="text/javascript"> </script>
 
<style>
 
<style>
pre { text-decoration: underline; }
 
pre { text-decoration: none; }
 
pre code { text-decoration: none; }
 
pre, div.rm pre, div.add pre { background-color: #f6f8fa; }
 
</style>
 
 
<div style="padding-left:67px;"><pre style="padding:0px 10px; margin: 0px;"><code class="language-javascript">function operation(operator) {
 
<div style="padding-left:67px;"><pre style="padding:0px 10px; margin: 0px;"><code class="language-javascript">function operation(operator) {
 
<nowiki><div style="background: white">
 
<nowiki><div style="background: white">
Line 79: Line 74:
 
</div>
 
</div>
 
<html>
 
<html>
 +
 +
<div id="codigo">
 +
<syntaxhighlight lang="java">
 +
var num1 = Number(document.getElementById("num1").value)
 +
    switch (operator) {
 +
        case "mul":  result = num1 * num2;  break
 +
        default:    result = num1 / num2
 +
    }
 +
    document.getElementById("placeholder").innerText = result
 +
}
 +
</syntaxhighlight>
 +
</div>
  
 
<div class="mw-collapsible mw-collapsed" style="margin-top: 30px; margin-bottom: 12px" data-expandtext="+/-" data-collapsetext="+/-">
 
<div class="mw-collapsible mw-collapsed" style="margin-top: 30px; margin-bottom: 12px" data-expandtext="+/-" data-collapsetext="+/-">

Revision as of 21:40, 17 March 2021





  • CSS

  • Code syntax highlighters

Retrieved from "http://wiki.sinfronteras.ws/index.php?title=Página_de_pruebas_2&oldid=22366"