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:
How to search text in string using php ?29-10-2017 php search string search |
How to insert bulk information into database in single query execution18-03-2017 insert sql bulk database |
Sanitization in java sript14-03-2017 sanitization java script |
Convert Time 24 hrs to 12 hrs format In javascript12-03-2017 date javascript 12hrs convert |
Get Unique values from array/object in javascript19-02-2017 javascript unique remove repeated values from array |