Wednesday, June 29, 2011

Re: [phpXperts] jQuery Help

 

Yes, You can. Here is sample code. :)


<script type="text/javascript">
$(function(){
$("input[type=text]").bind("focus",function(){
    var value = $(this).val();
    alert(value);
});

</script>

<input type="text" name="relation[]" class="text_relation" value="1"/>

<input type="text" name="relation[]" class="text_relation" value="2"/>

<input type="text" name="relation[]" class="text_relation" value="3"/>


** Just replace "focus" to "blur" for blur action.

Thanks.

From: asma tuli <asmatuli@gmail.com>
To: phpexperts@yahoogroups.com
Sent: Thursday, June 30, 2011 11:56 AM
Subject: [phpXperts] jQuery Help

 
I have 3 input text box like

<input type="text" name="relation[]" class="text_relation" />

<input type="text" name="relation[]" class="text_relation" />

<input type="text" name="relation[]" class="text_relation" />


I would like to apply .focus() and .blur() on each of them individually.

How is it possible ??


__._,_.___
Recent Activity:
Visit phpXperts website at www.phpxperts.net
.

__,_._,___

No comments: