Yes you can just use the .id
property of the dom element, for example:
myDOMElement.id
Or, something like this:
var inputs = document.getElementsByTagName("input");
for (var i = 0; i < inputs.length; i++) {
alert(inputs[i].id);
}
More Related Contents:
- Get the longest text in HTML document using Jquery or javascript
- Hide/Show image on one click [closed]
- Why can’t I call a function named clear from an onclick attribute?
- How to move an element into another element?
- Way to ng-repeat defined number of times instead of repeating over array?
- JavaScript Form Submit – Confirm or Cancel Submission Dialog Box
- innerText vs innerHTML vs label vs text vs textContent vs outerText
- Transfer data from one HTML file to another
- Which browsers support ?
- How do I check if a cookie exists?
- HTML 5 video or audio playlist
- jQuery: Get selected element tag name
- How to use greasemonkey to selectively remove content from a website
- HTML anchor link – href and onclick both?
- What is the meaning of polyfills in HTML5?
- How to prevent an HTTP request just for a favicon?
- HTML DOM: Which events do not bubble?
- Download textarea contents as a file using only Javascript (no server-side)
- Positioning divs in a circle using JavaScript
- Display image from blob using javascript and websockets
- jQuery: How to listen for DOM changes?
- Anyone have a diff algorithm for rendered HTML? [closed]
- scrollIntoView vs moveToElement
- Change image in HTML page every few seconds
- Extract the text out of HTML string using JavaScript
- How can I remove wrapper (parent element) without removing the child?
- Passing parameters to a JQuery function
- How to put a waved line under misspelled words HTML
- Can I save input from form to .txt in HTML, using JAVASCRIPT/jQuery, and then use it?
- Validate Dynamically Added Input fields