Probably a dumb question, but is there a way in JavaScript to find out the type of form element (text, checkbox, etc.) from the form element after finding it by name or identifier? Either in plain old JavaScript, or using syntax or jQuery-style methods would be ideal.
Example:
<input type="text" name="my_text_input" id="my_text_input"/>
<script>var element = document.getElementById('my_text_input'); </script>
I'm not looking for alternatives, this is exactly what I want to do. I am pretending to be a screen scraper that should collect this information.
user187702
source
share