I want to get id of my element by using name attribute, but there is an simple method in javascript. Here is the HTML
<input type="text" name="name" id="id">
In javacript,
var ele = document.getElementsByName( 'name' ); var id = ele[0].getAttribute( 'id' );
You might also like:
A Very Big Sum | Javascript | hackerrank07-05-2020 A Very Big Sum Javascript hackerrank |
Check null values in JavaScript?04-02-2019 JavaScript null check null value |
How to search text in string using php ?29-10-2017 php search string search |
How to redirect one page to another page in php20-03-2017 redirect php |
How to find Angular Errors06-03-2017 errors angularjs exceptionHandler |