'JavaScript'에 해당되는 글 1건

[JavaScript] - KeyEvent

JavaScript 2015. 2. 12. 16:28
<%@ page language="java" contentType="text⁄html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-⁄⁄W3C⁄⁄DTD HTML 4.01 Transitional⁄⁄EN" "http:⁄⁄www.w3.org⁄TR⁄html4⁄loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text⁄html; charset=UTF-8">
<title>KeyEvent Example<⁄title>
<link href=".⁄css⁄bootstrap.css" rel="stylesheet" media="screen">
<script type="text⁄javascript">
	function keyDown() {
		var inputText = document.getElementById("inputText");
		var spanMessage = document.getElementById("spanMessage");
		if (inputText.value.length > 0) {
			spanMessage.innerHTML = "keyDown";
		}
	}
	
	function keyUp() {
		var inputText = document.getElementById("inputText");
		var inputWarning = document.getElementById("spanMessage");
		if (inputText.value.length == 0) {
			spanMessage.innerHTML = "";
		}
	}
<⁄script>
<⁄head>
<body>
	<div class="control-group info">
		<label class="control-label">KeyEvent<⁄label>
		<div class="controls">
			<input type="text" id="inputText" onkeydown="keyDown()" onkeyup="keyUp()"> 
			<span class="help-inline" id="spanMessage"><⁄span>
		<⁄div>
	<⁄div>
<⁄body>
<⁄html>

블로그 이미지

행복그리고..

,