dom Questions

7

Solved

I have a string which contains HTML text. I need to escape just the strings and not tags. For example, I have string which contains, <ul class="main_nav"> <li> <a class="className...
Septimal asked 15/6, 2010 at 8:53

2

Solved

I'm using Angular 10, on click the following function is executed to preform direction change: private changeHtmlDirection(direction: 'rtl' | 'ltr') { document.getElementsByTagName("html&quot...
Cardialgia asked 5/1, 2021 at 19:24

22

Solved

I'm wondering if there's a way to count lines inside a div for example. Say we have a div like so: <div id="content">hello how are you?</div> Depending on many factors, the div can h...
Tanatanach asked 23/4, 2009 at 22:58

7

Solved

In visual studio code when changing the start tag type (e.g., from <div> to <span>) I want the editor to automatically change the matching closing tag. How can I do that?
Bregma asked 11/8, 2018 at 20:52

4

Solved

I am getting an error TypeError: Cannot read property 'classList' of null I am not really sure what am I doing wrong in manipulating DOM element for each form field. My form field has an stated...
Copley asked 20/10, 2018 at 20:25

3

Solved

I'm working on optimizing scrolling performance in my web app, and ran into interesting behavior on the latest Chrome (v31), which also repros on Chrome Canary (v34). In this simplified example, I...
Staciastacie asked 19/12, 2013 at 1:9

5

Solved

I am creating a website of floating width. The users use screens from full HD resolution to some 600px on smart phones it seems a pretty good idea. This brings up a very interesting problem. When ...
Overpowering asked 12/10, 2011 at 15:13

5

Solved

Does removeChild function really delete the child node completely? Or it just removes the element being child of the specified parant node? If it doesn't really deletes the element, is there a way ...
Homicidal asked 4/3, 2011 at 14:19

4

Solved

I am writing a piece of infrastructure that needs to be applied differently to HTML elements versus SVG elements. Given a DOM node, how can I tell if it''s an SVG or HTML element?
Transcendentalistic asked 23/12, 2013 at 18:4

3

Solved

I try to add new SVG elements to some nodes. For that purpose the nodes the elements are to be added to have to be found by a string contained in there text content, e.g. find any node which has "i...
Fushih asked 22/9, 2019 at 19:1

5

Solved

As title , how to JSON.stringify a dom element, and change back the json to a dom element. Any one know how to do , thanks. Here is the code : var container = document.querySelectorAll('.containe...
Harquebusier asked 23/10, 2017 at 1:31

4

Solved

I am using React 15 on Chrome and want to hook up an event listener to detect changes to a parent container. After looking around for options, I came across ResizeObserver and am not sure how to ge...
Cyndy asked 8/7, 2019 at 20:1

6

Solved

I am working on an extension for Chrome. I wish parse the content of the "original" Gmail message (the currently viewed message). I tried to utilize the jQuery.load() as follows $(windows).load(f...
Figge asked 7/3, 2012 at 13:1

2

Solved

I'm using the following function on each <option> to determine whether it is selected: var _matches = function(el, selector) { var fn = el.matches || el.matchesSelector || el.msMatchesSelec...
Semela asked 7/5, 2015 at 14:47

12

Solved

The React way to set which option is selected for a select box, is to set a special value prop on the <select> itself, corresponding to the value attribute on the <option> element you d...
Definitely asked 20/2, 2015 at 8:43

12

Solved

I'm working on an Angular2 application, and I need to display -- but disable an <a> HTML element. What is the correct way to do this? Updated Please note the *ngFor, this would prevent the ...
Bautzen asked 2/5, 2016 at 14:38

12

Solved

How do I listen to change events for a contentEditable-based control? function Number() { let [value, setValue] = useState('123'); function onChange(v) { // Doesn't fire :( console.log('chang...
Nobile asked 27/3, 2014 at 3:52

1

Solved

Webpages of forked GitHub repos display info such as "This branch is 10 commits behind". This used to be static HTML, but now that text appears with a delay. Specifically, a <span> ...

18

Solved

For some performance reasons, I am trying to find a way to select only sibling nodes of the selected node. For example, <div id="outer"> <div id="inner1"></div&g...
Blackface asked 9/5, 2009 at 0:9

10

Solved

While DOM still totally dominates the way we create UIs, does it make sense to create a bunch of entirely canvas-based UI components, like buttons, lists, horizontal/vertical groups, etc? I know ...
Eurhythmic asked 28/7, 2011 at 9:43

3

Solved

I have an element that I want to populate as a request's HTML streams in, instead of waiting for the complete response. This turned out to be incredibly difficult. Things I've tried: 1. milestone...
Philia asked 16/7, 2016 at 16:48

13

Solved

I’m using AJAX to append data to a <div> element, where I fill the <div> from JavaScript. How can I append new data to the <div> without losing the previous data found in it?
Kershaw asked 15/4, 2011 at 13:54

9

Solved

This sounds a little crazy, but I'm wondering whether possible to get reference to comment element so that I can dynamically replace it other content with JavaScript. <html> <head> &lt...
Dextral asked 17/5, 2011 at 7:50

11

I have a login form, when the page is opened, Chrome automatically fills the credentials. However, onChange event of input elements are not being triggered. Clicking anywhere on the page makes the...
Boehmer asked 19/3, 2019 at 15:29

6

Solved

I want to know, how to find out recursively all parent nodes of an element. Suppose i have following snippet <a href="#"><font>Hello</font></a> In this I would like to fin...
Conant asked 7/9, 2011 at 10:14

© 2022 - 2025 — McMap. All rights reserved.