Get all IDL attributes for an HTML Element
问题 I know it's possible to get all content attributes on a a standard HTMLElement like this: <input type="text" value="John" /> const input = document.querySelector("input"); const attrs = Array.from(input.attributes); console.log(attrs.map(a => a.name + ': ' a.value)); // [ "type: text", "value: John" ] I'm working in a world (Salesforce Lightning Web Components) where IDL attributes (i.e. those you can access via dot notation) aren't always exposed as content attributes at runtime. For example