Title: 2339 Property 'style' does not exist on type 'Element'. · Issue #3263 · microsoft/TypeScript · GitHub
Open Graph Title: 2339 Property 'style' does not exist on type 'Element'. · Issue #3263 · microsoft/TypeScript
X Title: 2339 Property 'style' does not exist on type 'Element'. · Issue #3263 · microsoft/TypeScript
Description: Some example of code: class Test { constructor(elem:Element) { elem.style.color = 'red'; }; } let elem = document.querySelector('#test'); let test = new Test(elem); This produces: 2339 Property 'style' does not exist on type 'Element'. I...
Open Graph Description: Some example of code: class Test { constructor(elem:Element) { elem.style.color = 'red'; }; } let elem = document.querySelector('#test'); let test = new Test(elem); This produces: 2339 Property 'st...
X Description: Some example of code: class Test { constructor(elem:Element) { elem.style.color = 'red'; }; } let elem = document.querySelector('#test'); let test = new Test(elem); This produces: 2...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/3263
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"2339 Property 'style' does not exist on type 'Element'.","articleBody":"Some example of code:\n\n``` typescript\nclass Test {\n constructor(elem:Element) {\n elem.style.color = 'red';\n };\n}\n\nlet elem = document.querySelector('#test');\nlet test = new Test(elem);\n```\n\nThis produces:\n`2339 Property 'style' does not exist on type 'Element'.`\nIf I change `elem:Element` to `elem:HTMLElement` then is says:\n`2345 Argument of type 'Element' is not assignable to parameter of type 'HTMLElement'.\n Property 'accessKey' is missing in type 'Element'.`\n\nI understand what `querySelector` might not always return HTML or SVG elements, but why `Element` does not have style property?\n","author":{"url":"https://github.com/NekR","@type":"Person","name":"NekR"},"datePublished":"2015-05-25T17:05:58Z","url":"https://github.com/microsoft/TypeScript/issues/3263"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cf8667eb-21fb-3bfb-12b0-3e072c4f3f3c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E6A2:1F6A:39521E:4D0550:6AFBEB98 |
| html-safe-nonce | 24d87a88cf23732bb7efc3360881bbda2dab7940ec43203bcedbe509a60aa0c5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkEyOjFGNkE6Mzk1MjFFOjREMDU1MDo2QUZCRUI5OCIsInZpc2l0b3JfaWQiOiIzMjY3Nzk0ODI0OTMyODc5MjU2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ecf8929b1be90f869bcb2ab113daaa75775f6f2010bb5be91c510c139f2b0afb |
| hovercard-subject-tag | issue:80600846 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/3263/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1ad6752f7aa843cc41efde2c339f0ecf7fe4d0fec2dcbc6e97ad002e0e1d5589/microsoft/TypeScript/issues/3263 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1ad6752f7aa843cc41efde2c339f0ecf7fe4d0fec2dcbc6e97ad002e0e1d5589/microsoft/TypeScript/issues/3263 |
| og:image:alt | Some example of code: class Test { constructor(elem:Element) { elem.style.color = 'red'; }; } let elem = document.querySelector('#test'); let test = new Test(elem); This produces: 2339 Property 'st... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NekR |
| hostname | github.com |
| expected-hostname | github.com |
| None | 744d4381b1c4dbd6d8736c7d7e5bbe7dc11217584e457a3555020c631764e8ec |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | df859c48a4c8b4c0009c19bb4e82101aacb4b998 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width