如何確定 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?
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章