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 |
Compare the Triplets | Javascript | hackerrank.com07-05-2020 hackerrank.com |
Functions in javascript25-05-2018 functions javascript es5 es6 arrow functions named functions Closures Nested Functions Callbacks Arrow functions. |
How to use request module in node js16-03-2017 request module node js |
Filter for replace text in Angular Js05-03-2017 filter replace angular js |