Skip to content
Advertisement

Tag: element

How can i get an ID from a select multiple using Element?

I have a select for persons assigned to a proyect, so i need to send the ID from the object selected to a function i tried: Array persons: Method The pid (person id) is undefined and i can’t find a solution for my case, i will appreciate help and comments. Answer You are facing what is referenced in Vue.js documentation

document.querySelector multiple data-attributes in one element

I’m trying to find an element with document.querySelector which has multiple data-attributes: I thought about something like this: But it does not work. However, it works well, if I put the second data-attribute in a child-element like: So, is there an option to search for both attributes at once?I’ve tried several options but I don’t get it. Answer There should

Remove first child in javascript

I’m trying to remove the first li in an ol using the DOM removeChild(). But for some reason it doesn’t work. This is my javascript: And this is my HTML: I tried alerting the childNodes[0], and it returns [Object Text], which seems a bit weird, when I was expecting just the object. Hope I’ve been clear. Answer Between the <ol

Advertisement