Solved

get name attribute value

Posted on 2014-07-17
7
217 Views
Last Modified: 2014-07-19
http://jsfiddle.net/sevensnake/UugWW/133/

I like to get the name attribute value.
I will use it to pass it .

so if I need id comment I can get the name attribute value from it.
0
Comment
Question by:sevensnake77
  • 3
  • 2
7 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 40202717
Confused what you are trying to get, there are no inputs or text type elements in the fiddle.
0
 
LVL 9

Author Comment

by:sevensnake77
ID: 40202744
http://jsfiddle.net/sevensnake/UugWW/135/


Ok get the name value of the textarea. for example if i want id=Comments2 name value only  and pass it to my textbox.
0
 
LVL 9

Author Comment

by:sevensnake77
ID: 40202753
so it will look like this.
http://jsfiddle.net/sevensnake/UugWW/139/
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 58

Accepted Solution

by:
Gary earned 250 total points
ID: 40202774
If you want to get the name value of element with a specific ID then use

$("#Comments2").attr("name")

http://jsfiddle.net/UugWW/144/

Else it is still not making sense
0
 
LVL 82

Assisted Solution

by:leakim971
leakim971 earned 250 total points
ID: 40202778
to get the name attribute : .attr("name")
example :

var name = $("#yourId").attr("name");

Open in new window

0
 
LVL 9

Author Comment

by:sevensnake77
ID: 40202785
yeah couldn't think of the syntax.  Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

by Julian Matz As of jQuery (http://jquery.com/) 1.4 the .live() method (http://api.jquery.com/live/) supports custom events as well as some standard JavaScript events that it previously didn't support. Among these is the submit event. Unlike …
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question