dom Questions

4

Solved

I have a string value that I'm trying to extract list items for. I'd like to extract the text and any subnodes, however, DOMDocument is converting the entities to the character, instead of leaving ...
Dray asked 8/9, 2011 at 4:56

3

In one of my views I have: events: { 'click .tab': 'doSomething', }, then: doSomething: function(){ ... }, This is a recurring structure in my views, but for some reason the 'doSomething' f...
Tergiversate asked 15/9, 2012 at 0:13

2

I want manipulate an html string, in vanillaJS I would do it something like this: let HTMLString = '<p>hello</p> <style> p{ color:black } <p>world</p> ' const...
Weak asked 10/6, 2021 at 5:26

3

Solved

Is there a way to select an element by innerHTML without using loops? Can it be done using something like document.querySelector('div[innerHTML="Sometext"]') or document.querySelector('div[text...
Eurystheus asked 8/12, 2015 at 23:52

4

Solved

Look this very simple code <!DOCTYPE html> <html> <head> <style> p::before { content: "Before - "; } </style> </head> <body> <p>Hello</p> &lt...
Candler asked 10/12, 2014 at 2:7

9

Solved

I am trying to delete tweets in the JS console on my Twitter page. If I do it manually by selecting the button and then doing a click, I can manually run 3 different functions. const delButton=()=&...
Viburnum asked 16/11, 2020 at 17:48

2

Solved

When querying the DOM, is there any reason why labels aren't available as children? var el = document.getElementById("myEl"); var group = el.closest(".form-group"); var ipt = el.closest(".f...
Aegospotami asked 22/2, 2018 at 21:24

7

Solved

I know we can use PHP DOM to parse HTML using PHP, but I have a specific requirement. I have an HTML content like below <p class="Heading1-P"> <span class="Heading1-H"...
Indignity asked 21/8, 2013 at 4:55

15

Solved

What is the perfect way to find all nextSiblings and previousSiblings in JavaScript. I tried few ways but not getting accurate solution. If any element is selected, I need to get length of all next...
Coon asked 7/12, 2010 at 16:9

3

Solved

I'm trying to use javascript to create a button that has a onclick event that calls a function defined in the head that takes in as parameter a dom object relative to the button. how do i do this? ...
Retardment asked 28/12, 2011 at 1:34

2

Solved

I have an array of Elements and I want them in document order. I know this is trivial to achieve in XPath, but the logic I have to implement is a bit complicated for a single expression. I did fin...
Eliaeliades asked 13/8, 2015 at 14:34

6

I have a dynamic text in a span. I would like to use line-clamp: 2. In that case there are max. 2 lines of text and the rest is truncated by …. That works with: display: -webkit-box; -webkit-line-c...
Neurotic asked 4/9, 2018 at 15:19

3

Solved

Every TypeScript example and tutorial I have found thus far is about language features, Static typing, Visual Studio, etc. I cannot find anything to tell me how I should be using it with reference ...
Lavonna asked 4/4, 2017 at 14:51

2

Solved

I want to be able to find out which DOM elements are present in the text currently selected by the user in the browser. document.getSelection() would get us the currently selected text. But how c...
Prolate asked 27/3, 2010 at 12:49

2

Solved

I accidentally discovered that scrollTop, and scrollLeft on an element work even when an element is overflow: hidden. Can this behaviour be relied on? Supposedly scrollTop, and scrollLeft are supp...
Gook asked 13/11, 2015 at 23:11

4

Solved

Is there a way to preserve the highlight showing the boxmodel properties (width, margin, padding, border) of a DOM element? I'm trying to inspect the behaviour of an element when the window is resi...
Euphemie asked 3/5, 2012 at 7:27

5

Solved

Vue has this nextTick function, which is an async function that waits until the DOM is flushed. This is particularly useful when you want to perform some operation directly upon an element, like sc...
Zuckerman asked 21/6, 2022 at 16:59

5

Solved

I've opened a new window with window.open() and I want to use the reference from the window.open() call to then write content to the new window. I've tried copying HTML from the old window to the n...
Avast asked 4/10, 2008 at 5:54

6

Solved

I have a javascript function that tries to determine whether a div is visible and does various processes with that variable. I am successfully able to swap an elements visibility by changing it's d...
Argueta asked 27/4, 2013 at 18:18

3

Solved

I am getting crazy and need your help. I am working on a serviceworker project and I am dealing with a javascript problem. I have two main files. The server.html file in which I call the external ...
Orff asked 8/6, 2016 at 13:57

5

Solved

I'm trying to get the screen coordinates (that is, relative to the top left corner of the screen) of an element in a browser window. It's easy to get the size and position of the window (screenX, s...
Malefaction asked 25/2, 2010 at 21:32

4

I'm trying to convert XML files to YAML using Python 3.3. This is my code: #! /etc/python3 test_filename_input = './reference-conversions/wikipedia-example.xml' test_filename_output = 'wikipedia-...
Eure asked 23/8, 2014 at 22:41

3

Solved

I've got a may confusing question because it does not fit standard-behaviour how react and the virtual dom works but i would like to know the answer anyway. Imagine i've got a simple react-compone...
Lewse asked 10/9, 2018 at 14:40

4

Solved

I want to detect when a node (nodeX, say) is no longer available, either because it was deleted or because its parent (or its parents parent) was deleted. So far, all I can think of is to use Muta...
Samara asked 5/7, 2017 at 20:57

6

Solved

I am trying to get the form data key-value pair object when the form is submitted, using the new FormData() constructor. But it always returns empty data. I have already tried event.persist() to a...
Clothesbasket asked 20/5, 2019 at 5:56

© 2022 - 2024 — McMap. All rights reserved.