Skip to main content
Improve title, remove noise.
Source Link
Drenmi
  • 8.8k
  • 4
  • 46
  • 52

My question might be an easy to handle one. But here it goes!

I was creatingCreating a plugin in jQuery and on my wayjQuery, I have to get the names of input fields on which the events would occur.

Suppose:

<input type="text" name="name" />
<input type="text" name="age" />

Then it will beWhether submitted or not, doesn't matter. What I want is to get the name of the field.

I have tried a stupid code, which even I know is a stupid one, but here it isthe following:

$('#ins').html($(this).attr('name').val());

#ins is the div, where I am writing the events such as a clickclick was made on the input with name = name = name. This way I want to create a plugin which would guide me to get to know which fields are getting some events.

My question might be an easy to handle one. But here it goes!

I was creating a plugin in jQuery and on my way, I have to get the names of input fields on which the events would occur.

Suppose:

<input type="text" name="name" />
<input type="text" name="age" />

Then it will be submitted or not, doesn't matter. What I want is to get the name of the field.

I have tried a stupid code, which even I know is a stupid one, but here it is:

$('#ins').html($(this).attr('name').val());

#ins is the div, where I am writing the events such as a click was made on the input with name = name. This way I want to create a plugin which would guide me to get to know which fields are getting some events.

Creating a plugin in jQuery, I have to get the names of input fields on which events would occur.

Suppose:

<input type="text" name="name" />
<input type="text" name="age" />

Whether submitted or not doesn't matter. What I want is to get the name of the field.

I tried the following:

$('#ins').html($(this).attr('name').val());

#ins is the div, where I am writing the events such as a click was made on the input with name = name. This way I want to create a plugin which would guide me to get to know which fields are getting some events.

How to get input field's name jqueryof an input field using jQuery?

How to get input field's name jqueryof an input field using jQuery?

My question might be an easy to handle one. But here it goes!

I was creating a plugin in jQuery and on my way, I have to get the names of input fields on which the events would occur.

Suppose:

<input type="text" name="name" />
<input type="text" name="age" />

Then it will be submitted or not, doesn't matter. What I want is to get the name of the field.

I have tried a stupid code, which even I know is a stupid one, but here it is:

$('#ins').html($(this).attr('name').val());

#ins is the div, where I am writing the events such as a click was made on the input with name = name. This way I want to create a plugin which would guide me to get to know which fields are getting some events.

How to get input field's name jquery

My question might be an easy to handle one. But here it goes!

I was creating a plugin in jQuery and on my way, I have to get the names of input fields on which the events would occur.

Suppose:

<input type="text" name="name" />
<input type="text" name="age" />

Then it will be submitted or not, doesn't matter. What I want is to get the name of the field.

I have tried a stupid code, which even I know is a stupid one, but here it is:

$('#ins').html($(this).attr('name').val());

#ins is the div, where I am writing the events such as a click was made on the input with name = name. This way I want to create a plugin which would guide me to get to know which fields are getting some events.

How to get name of an input field using jQuery?

My question might be an easy to handle one. But here it goes!

I was creating a plugin in jQuery and on my way, I have to get the names of input fields on which the events would occur.

Suppose:

<input type="text" name="name" />
<input type="text" name="age" />

Then it will be submitted or not, doesn't matter. What I want is to get the name of the field.

I have tried a stupid code, which even I know is a stupid one, but here it is:

$('#ins').html($(this).attr('name').val());

#ins is the div, where I am writing the events such as a click was made on the input with name = name. This way I want to create a plugin which would guide me to get to know which fields are getting some events.

Source Link
Afzaal Ahmad Zeeshan
  • 15.9k
  • 14
  • 61
  • 106

How to get input field's name jquery

My question might be an easy to handle one. But here it goes!

I was creating a plugin in jQuery and on my way, I have to get the names of input fields on which the events would occur.

Suppose:

<input type="text" name="name" />
<input type="text" name="age" />

Then it will be submitted or not, doesn't matter. What I want is to get the name of the field.

I have tried a stupid code, which even I know is a stupid one, but here it is:

$('#ins').html($(this).attr('name').val());

#ins is the div, where I am writing the events such as a click was made on the input with name = name. This way I want to create a plugin which would guide me to get to know which fields are getting some events.