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 |
How to make an http request in node js14-03-2017 http module node js |
Remove last two characters from given string06-03-2017 substring javascript remove |
Filter for change Date Time format (MM-dd-yyyy HH:mm) in Angular Js05-03-2017 mm-dd-yyyy HH:MM date formats angular js |
How to change background color and color to the text using javascript27-02-2017 css javascript colors |