Property id is not defined in type Node in PhpStorm/WebStormDetecting an undefined object propertyHow can I merge properties of two JavaScript objects dynamically?How do I remove a property from a JavaScript object?What is the preferred syntax for defining enums in JavaScript?Sort array of objects by string property valueRemove all child elements of a DOM node in JavaScriptJavaScript check if variable exists (is defined/initialized)Iterate through object propertiesCan IntelliJ IDEA encapsulate all of the functionality of WebStorm and PHPStorm through plugins?Difference between WebStorm and PHPStorm
Bash method for viewing beginning and end of file
Can criminal fraud exist without damages?
Efficiently merge handle parallel feature branches in SFDX
Can a monster with multiattack use this ability if they are missing a limb?
Why are on-board computers allowed to change controls without notifying the pilots?
Will it be accepted, if there is no ''Main Character" stereotype?
Generic lambda vs generic function give different behaviour
Failed to fetch jessie backports repository
The baby cries all morning
Using parameter substitution on a Bash array
Is a roofing delivery truck likely to crack my driveway slab?
Products and sum of cubes in Fibonacci
How does a character multiclassing into warlock get a focus?
Trouble understanding overseas colleagues
What are the ramifications of creating a homebrew world without an Astral Plane?
Curses work by shouting - How to avoid collateral damage?
when is out of tune ok?
Greatest common substring
What is the oldest known work of fiction?
How could Frankenstein get the parts for his _second_ creature?
Everything Bob says is false. How does he get people to trust him?
Is there an Impartial Brexit Deal comparison site?
Should my PhD thesis be submitted under my legal name?
There is only s̶i̶x̶t̶y one place he can be
Property id is not defined in type Node in PhpStorm/WebStorm
Detecting an undefined object propertyHow can I merge properties of two JavaScript objects dynamically?How do I remove a property from a JavaScript object?What is the preferred syntax for defining enums in JavaScript?Sort array of objects by string property valueRemove all child elements of a DOM node in JavaScriptJavaScript check if variable exists (is defined/initialized)Iterate through object propertiesCan IntelliJ IDEA encapsulate all of the functionality of WebStorm and PHPStorm through plugins?Difference between WebStorm and PHPStorm
Php/WebStorm is reporting this wierd warning in my JavaScript code stating that property id
is not defined in the element/node. Thing is, the element is a firstChild
element fetched from the parent element.
function hideChildAndUpdateID(title)
let parent = document.getElementById('parent');
let child = parent.firstChild;
// Hiding the child.
child.style.display = 'none';
// Temporary ID so we can find it later.
child.id = 'child-tmp-id'; // Warning occurs here
And this is the entire message from Php/WebStorm
Property id is not defined in type Node less... (Ctrl+F1)
Inspection info: This inspection reports assignments to undefined properties of explicitly type-annotated variables.
This code itself actually works. The child
element gets it's id
changed to whatever I set it to, but this warning is anoying me.
I have tried using child.setAttribute('id', 'child-tmp-id')
, but that did not work properly.
Is there a convention when dealing with firstChild
or it's just a Php/WebStorm thingy?
javascript dom phpstorm webstorm
add a comment |
Php/WebStorm is reporting this wierd warning in my JavaScript code stating that property id
is not defined in the element/node. Thing is, the element is a firstChild
element fetched from the parent element.
function hideChildAndUpdateID(title)
let parent = document.getElementById('parent');
let child = parent.firstChild;
// Hiding the child.
child.style.display = 'none';
// Temporary ID so we can find it later.
child.id = 'child-tmp-id'; // Warning occurs here
And this is the entire message from Php/WebStorm
Property id is not defined in type Node less... (Ctrl+F1)
Inspection info: This inspection reports assignments to undefined properties of explicitly type-annotated variables.
This code itself actually works. The child
element gets it's id
changed to whatever I set it to, but this warning is anoying me.
I have tried using child.setAttribute('id', 'child-tmp-id')
, but that did not work properly.
Is there a convention when dealing with firstChild
or it's just a Php/WebStorm thingy?
javascript dom phpstorm webstorm
add a comment |
Php/WebStorm is reporting this wierd warning in my JavaScript code stating that property id
is not defined in the element/node. Thing is, the element is a firstChild
element fetched from the parent element.
function hideChildAndUpdateID(title)
let parent = document.getElementById('parent');
let child = parent.firstChild;
// Hiding the child.
child.style.display = 'none';
// Temporary ID so we can find it later.
child.id = 'child-tmp-id'; // Warning occurs here
And this is the entire message from Php/WebStorm
Property id is not defined in type Node less... (Ctrl+F1)
Inspection info: This inspection reports assignments to undefined properties of explicitly type-annotated variables.
This code itself actually works. The child
element gets it's id
changed to whatever I set it to, but this warning is anoying me.
I have tried using child.setAttribute('id', 'child-tmp-id')
, but that did not work properly.
Is there a convention when dealing with firstChild
or it's just a Php/WebStorm thingy?
javascript dom phpstorm webstorm
Php/WebStorm is reporting this wierd warning in my JavaScript code stating that property id
is not defined in the element/node. Thing is, the element is a firstChild
element fetched from the parent element.
function hideChildAndUpdateID(title)
let parent = document.getElementById('parent');
let child = parent.firstChild;
// Hiding the child.
child.style.display = 'none';
// Temporary ID so we can find it later.
child.id = 'child-tmp-id'; // Warning occurs here
And this is the entire message from Php/WebStorm
Property id is not defined in type Node less... (Ctrl+F1)
Inspection info: This inspection reports assignments to undefined properties of explicitly type-annotated variables.
This code itself actually works. The child
element gets it's id
changed to whatever I set it to, but this warning is anoying me.
I have tried using child.setAttribute('id', 'child-tmp-id')
, but that did not work properly.
Is there a convention when dealing with firstChild
or it's just a Php/WebStorm thingy?
javascript dom phpstorm webstorm
javascript dom phpstorm webstorm
asked Mar 8 at 9:30
omerowitzomerowitz
1,61241744
1,61241744
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Nodes can be more than just elements and don't necessarily have an id
property. Try using firstElementChild
instead that returns the first child that is an element:
function hideChildAndUpdateID(title)
let parent = document.getElementById('parent');
let child = parent.firstElementChild;
// Hiding the child.
child.style.display = 'none';
// Temporary ID so we can find it later.
child.id = 'child-tmp-id';
I have in the mean time used thesetAttributeNode
along withcreateAttribute
and that worked too, but this is way nicer. Thanks.
– omerowitz
Mar 8 at 11:31
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060264%2fproperty-id-is-not-defined-in-type-node-in-phpstorm-webstorm%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Nodes can be more than just elements and don't necessarily have an id
property. Try using firstElementChild
instead that returns the first child that is an element:
function hideChildAndUpdateID(title)
let parent = document.getElementById('parent');
let child = parent.firstElementChild;
// Hiding the child.
child.style.display = 'none';
// Temporary ID so we can find it later.
child.id = 'child-tmp-id';
I have in the mean time used thesetAttributeNode
along withcreateAttribute
and that worked too, but this is way nicer. Thanks.
– omerowitz
Mar 8 at 11:31
add a comment |
Nodes can be more than just elements and don't necessarily have an id
property. Try using firstElementChild
instead that returns the first child that is an element:
function hideChildAndUpdateID(title)
let parent = document.getElementById('parent');
let child = parent.firstElementChild;
// Hiding the child.
child.style.display = 'none';
// Temporary ID so we can find it later.
child.id = 'child-tmp-id';
I have in the mean time used thesetAttributeNode
along withcreateAttribute
and that worked too, but this is way nicer. Thanks.
– omerowitz
Mar 8 at 11:31
add a comment |
Nodes can be more than just elements and don't necessarily have an id
property. Try using firstElementChild
instead that returns the first child that is an element:
function hideChildAndUpdateID(title)
let parent = document.getElementById('parent');
let child = parent.firstElementChild;
// Hiding the child.
child.style.display = 'none';
// Temporary ID so we can find it later.
child.id = 'child-tmp-id';
Nodes can be more than just elements and don't necessarily have an id
property. Try using firstElementChild
instead that returns the first child that is an element:
function hideChildAndUpdateID(title)
let parent = document.getElementById('parent');
let child = parent.firstElementChild;
// Hiding the child.
child.style.display = 'none';
// Temporary ID so we can find it later.
child.id = 'child-tmp-id';
answered Mar 8 at 11:21
lenalena
54k37685
54k37685
I have in the mean time used thesetAttributeNode
along withcreateAttribute
and that worked too, but this is way nicer. Thanks.
– omerowitz
Mar 8 at 11:31
add a comment |
I have in the mean time used thesetAttributeNode
along withcreateAttribute
and that worked too, but this is way nicer. Thanks.
– omerowitz
Mar 8 at 11:31
I have in the mean time used the
setAttributeNode
along with createAttribute
and that worked too, but this is way nicer. Thanks.– omerowitz
Mar 8 at 11:31
I have in the mean time used the
setAttributeNode
along with createAttribute
and that worked too, but this is way nicer. Thanks.– omerowitz
Mar 8 at 11:31
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060264%2fproperty-id-is-not-defined-in-type-node-in-phpstorm-webstorm%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown