Labels

Cerpen (18) html (16) movie (10) modul (7) SAP Security (2) c++ (2) Business (1)

Monday, 22 February 2016

kod html untuk tukar perkataan dri besar kpd kecik dan ambil karakter terawal

kod untuk tukar perkataan dri besar kpd kecik dan ambil karakter terawal


<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title>String Methods split and substring</title>
<script type = "text/javascript">
<!--
function splitButtonPressed()
{
var inputString = document.getElementById( "inputVal" ).value;
var inputString = inputString.toUpperCase();
var tokens = inputString.split( " " );
document.getElementById( "output" ).value =
tokens.join( "\n" );;
document.getElementById( "outputSubstring" ).value =
inputString.substring( 0, 10 );
} // end function splitButtonPressed
// -->
</script>
</head>
<body>
<form action = "">
<p>Enter a sentence to split into words<br />
<input id = "inputVal" type = "text" size = "40" />
<input type = "button" value = "Split"
onclick = "splitButtonPressed()" /></p>
<p>The sentence split into words is<br />
<textarea id = "output" rows = "8" cols = "34">
</textarea></p>
<p>The first 10 characters of the input string are
<input id = "outputSubstring" type = "text"
size = "15" /></p>
</form>
</body>
</html>

No comments:

Post a Comment