<html>
<head>
<meta content="charset=utf-8">
<script language="javascript">
function strcmp(){
var string1 = document.str.str1.value;
var string2 = document.str.str2.value;
var convert1 = String.toUpperCase(string1);
var convert2 = String.toUpperCase(string2);
if(convert1==convert2){
document.str.out.value="일치함\n\n" +"String1 : " +string1 +"\n" +"String2 : " +string2 +"\n" +"\n" +"Convert1 : " +convert1 +"\n" +"Convert2 : " +convert2;
}else{
document.str.out.value="일치하지 않음\n\n" +"String1 : " +string1 +"\n" +"String2 : " +string2 +"\n" +"\n"+"Convert1 : " +convert1 +"\n" +"Convert2 : " +convert2;
}
}
</script>
<title>String 비교</title>
</head>
<body>
<form name="str">
String 1 : <input type="text" name="str1" size="10">
<input type="button" value="창닫기" onclick="window.close()">
<br>
String 2 : <input type="text" name="str2" size="10">
<input type="button" value="문자열 비교"onclick="strcmp()">
<br>
<textarea name="out" cols="23" rows="7" readonly></textarea>
</form>
</body>
</html>
'Study > Programming' 카테고리의 다른 글
자바 String, StringBuffer (0) | 2009.05.15 |
---|---|
자바 equals (0) | 2009.05.15 |
자바스크립트 주민등록번호 체크 (1) | 2009.05.14 |
자바스크립트 Java Script (0) | 2009.05.13 |
CSS (0) | 2009.05.12 |