* keydown , keypress both the events are same , this events will rise/fire whenever we click the key button
* keyup event will rise whenever we click and release key button
* keyup and keydown both are case insensitive
It means a , A , other languages also that button will return always same value
* Control buttons like Home,Delete,PageUp,PageDown,Backspace,Space,Tab,CapsLock,Shift,Ctr,Alt,Arrow button will work only for keydown and keyup event , these buttons will not work with keypress event
* keypress event will return the keyboard values based on the language you selected and it depends on case sensitive.
Key Down Event
<html>
<head>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$("#keydownId").keydown(function(e) {
functionOne(e);
});
});
</script>
<script>
function functionOne(key) {
alert(key.which);
}
</script>
</head>
<body>
<div>
KeyDown Event <input type="text" id="keydownId"/>
</div>
</body>
</html>
Key Up Event
<html>
<head>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$("#keyupId").keyup(function(e) {
functionOne(e);
});
$("#getVal").click(function(e) {
var val = $("#keyupId").val();
alert(val);
});
});
</script>
<script>
function functionOne(key) {
alert(key.which);
}
</script>
</head>
<body>
<div>
KeyUp Event <input type="text" id="keyupId"/>
Click to Get Value <button id="getVal">Get Val</button>
</div>
</body>
</html>
Key Press Event
<html>
<head>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$("#keypressId").keypress(function(e) {
functionOne(e);
});
});
</script>
<script>
function functionOne(key) {
alert(key.which);
}
</script>
</head>
<body>
<div>
KeyPress Event <input type="text" id="keypressId"/>
</div>
</body>
</html>
* keyup event will rise whenever we click and release key button
* keyup and keydown both are case insensitive
It means a , A , other languages also that button will return always same value
* Control buttons like Home,Delete,PageUp,PageDown,Backspace,Space,Tab,CapsLock,Shift,Ctr,Alt,Arrow button will work only for keydown and keyup event , these buttons will not work with keypress event
* keypress event will return the keyboard values based on the language you selected and it depends on case sensitive.
Key Down Event
<html>
<head>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$("#keydownId").keydown(function(e) {
functionOne(e);
});
});
</script>
<script>
function functionOne(key) {
alert(key.which);
}
</script>
</head>
<body>
<div>
KeyDown Event <input type="text" id="keydownId"/>
</div>
</body>
</html>
Key Up Event
<html>
<head>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$("#keyupId").keyup(function(e) {
functionOne(e);
});
$("#getVal").click(function(e) {
var val = $("#keyupId").val();
alert(val);
});
});
</script>
<script>
function functionOne(key) {
alert(key.which);
}
</script>
</head>
<body>
<div>
KeyUp Event <input type="text" id="keyupId"/>
Click to Get Value <button id="getVal">Get Val</button>
</div>
</body>
</html>
Key Press Event
<html>
<head>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
$("#keypressId").keypress(function(e) {
functionOne(e);
});
});
</script>
<script>
function functionOne(key) {
alert(key.which);
}
</script>
</head>
<body>
<div>
KeyPress Event <input type="text" id="keypressId"/>
</div>
</body>
</html>
Always Love to read your Blog!
ReplyDeleteXcl technologies | Dubai web design | SEO dubai
Xcl technologies | dubai web development | company branding
ReplyDeleteYour very own commitment to getting the message throughout came to be rather powerful and have consistently enabled employees just like me to arrive at their desired goals.
Web Designing Training in Chennai | No.1 Web Designing Course Training in Chennai
SQL Server Training in Chennai | Best No.1 SQL Server Course Training in Chennai
Digital Marketing Training in Chennai | Best Digital Marketing Course Training in Chennai
Java Training in Chennai | Best Java Training in Chennai
C C++ Training in Chennai | Best C C++ Training in Chennai