Home Tutorial Jquery jQuery 'select' form event

 
 

Share on Google+Share on Google+
jQuery 'select' form event
Posted on: August 3, 2010 at 12:00 AM
Advertisement
In this tutorial, we will discuss about 'select ' form event to display message when we select something inside input box.

jQuery 'select' form event

In this tutorial, we will discuss about 'select ' form event to display message when we select something inside input box. In this Example, two input text box are given , when we select something inside text box , it will display message "Some text was selected" . This is due to the "select" event .

selectFormEvent.html

<!DOCTYPE html>
<html>
<head>
<style>
p { color:blue; }
div { color:red; }
</style>
<script src="jquery-1.4.2.js"></script>
</head>
<body>
<p>

Click and drag the mouse to select text in the input box.
</p>
<input type="text" value="Select something" />
<input type="text" value="Select some text" />

<div></div>
<script>
$("input").select( function () {
$("div").text("Some text was selected").show().fadeOut(1000);
});
</script>
</body>
</html>

OUTPUT

When we select some text inside inputs :

Download Source Code

Click here to see demo

Advertisement

Related Tags for jQuery 'select' form event:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: August 3, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com