如何确定 JavaScript 中 HTML 元素的类型? - How can I determine the type of an HTML element in JavaScript?

问题:

I need a way to determine the type of an HTML element in JavaScript.我需要一种方法来确定 JavaScript 中 HTML 元素的类型。 It has the ID, but the element itself could be a <div> , a <form> field, a <fieldset> , etc. How can I achieve this?它有 ID,但元素本身可以是<div><form>字段、 <fieldset>等。我怎样才能做到这一点?


解决方案:

参考一: https://stackoom.com/question/149e
参考二: How can I determine the type of an HTML element in JavaScript?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章