---
title: "How to get a value of an element by name instead of ID"  
description: "How to get a value of an element by name instead of ID"  
author: "Anonymous User"  
published: 2018-03-20  
updated: 2018-03-20  
canonical: https://www.mindstick.com/forum/34443/how-to-get-a-value-of-an-element-by-name-instead-of-id  
category: "jquery"  
tags: ["jquery"]  
reading_time: 1 minute  

---

# How to get a value of an element by name instead of ID

I want to get [value](https://www.mindstick.com/articles/23219/an-optimized-description-adds-value-to-experience-and-in-turn-effectively-guest-posting-packages) of element by using its [name](https://yourviews.mindstick.com/view/87450/how-to-generate-a-brand-name-using-linkedin-comprehensive-guide) .I have done by using id

$('#id').val();

\

## Replies

### Reply by Anonymous User

Hi, Ramesh

You can do this by using the name attribute selector:

$("input[name=nameGoesHere]").val();


---

Original Source: https://www.mindstick.com/forum/34443/how-to-get-a-value-of-an-element-by-name-instead-of-id

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
