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:
Detect AdBlock with JavaScript in my browser30-07-2017 AdBlock javascript detect |
How to insert bulk information into database in single query execution18-03-2017 insert sql bulk database |
How to use request module in node js16-03-2017 request module node js |
How to convert html to pdf in Node js12-03-2017 pdf convert html node js |
How to get current date and time (yyyy-mm-dd H:i:s) using javascript09-03-2017 javascript date time |