Exercise:
Convert the value of txt to upper case.
Hint
Hint: Use the toUpperCase() method.
Edit This Code:
See Result »
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var txt = "Hello World"; document.getElementById("demo").innerHTML = txt; </script> </body> </html>
Result:
Show Answer
Correct Code:
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> var txt = "Hello World"; document.getElementById("demo").innerHTML = txt.toUpperCase(); </script> </body> </html>
Correct Result:
Hide Answer
Privacy Policy