JSFiddle - React, Tailwind, and code Playground

by Rufuus06

HTML

<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>toUpperCase()</title>
  </head>
  
  <body>
    
    <h2>toUpperCase():</h2>
    <p>Convierte un String de minúsculas a mayúculas.</p>
  
    <button onclick="myFunction()">
    Mayúscula
    </button>
  
    <p id="exp1">hola mundo!</p>
    <p id="exp"></p>
    
  </body>
  
</html>

JavaScript

function myFunction()
{
	var txt1 = document.getElementById("exp1").innerHTML;
  var txt2 = txt1.toUpperCase();
  document.getElementById("exp").innerHTML = txt2;
}