Thursday, July 21, 2011

JavaScript Exercises - toUpperCase() and toLowerCase().

example:
JavaScript Exercises - toUpperCase() and toLowerCase()

<!DOCTYPE html>
<html>
<head>
<title>JavaScript Exercise</title>
<script type="text/javascript">

function exercise(){
var stringsource = "A man and a pen";
var result = "stringsource = " + stringsource + "\n\n";
result += "toUpperCase(): " + stringsource.toUpperCase() + "\n";
result += "toLowerCase(): " + stringsource.toLowerCase() + "\n";
alert(result);
}


function htmlonload(){
exercise();
}
</script>
</head>
<body onload="htmlonload();">
JavaScript Exercise
</body>
</html>


No comments:

Post a Comment