Click here to Skip to main content
15,893,668 members
Everything / DOM

DOM

DOM

Great Reads

by Gerd Wagner
Don't confuse a DOM collection with a JS array: Array functions, such as the forEach looping method, cannot be applied to a DOM collection!
by bmiller367
jQuery XML Parser and Search
by David Catuhe
Vorlon.js is powered by node.JS, socket.io, and late-night coffee. I would like to share with you why we made it, how to incorporate it into your own testing workflow, and also share some more details into the art of building a JS library like it.
by David Catuhe
This article is the first in a series that will take a detailed look at one specific feature of Vorlon.js, starting with one of the biggest: the DOM Explorer.

Latest Articles

by honey the codewitch
A parser generator and unification system for different parsing tools
by thorssig
html2struct parses HTML code into a simple tree-like structure of objects and provides a little tool-set for extracting data from it
by Gerd Wagner
How to drop a DOM node without consulting its parent
by Silvia Campo
How expensive DOM manipulation can be

All Articles

Sort by Updated

DOM 

3 Jan 2024 by mickohan
Friends, I am able to unmarshall signature block for most of the cases with below code. However its failing to unmarshall for STRTransform case. Can someone guide me? Exception: Exception in thread "main" javax.xml.crypto.MarshalException:...
17 Nov 2023 by Yount_0701
Hello. Here is the problem of my code. There is a html content with pages labels on the bottom , I can click the page labels, then the content changed. I'm using js code to simulate this operation , click each page label , then fetch the content...
26 Jul 2023 by Larry Chapman II
The following XML document is stored in an object called "x": Tove Jani Reminder Don't forget me this weekend What will each of the following...
26 Jul 2023 by Richard MacCutchan
The document.write statement is part of the HTML DOM, and nothing to do with XML. XML is merely a useful way of formatting data for transmission between computing systems or applications. So it seems that you are mixing two different systems...
26 Jul 2023 by Larry Chapman II
Okay so, as far as I've come along this is essentially what I'm trying to do here: something else should be showing var parser, xmlDoc; var text =...
25 Jul 2023 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
9 Nov 2022 by wiam leo
We have images in folders, named (face1.png,...,face6.png) using this code; I can't display images, we randomly retrieve photos: import React from "react"; import jeuxde from "../images/jeuxde.jpg"; export default class JeuDe extends...
9 Nov 2022 by wiam leo
I solved the problems import React from "react"; import jeuxde from "../images/jeuxde.jpg"; export default class JeuDe extends React.Component{ constructor (props){ super(props); this.state= {face: null, compteur: 0, fin:...
7 Nov 2022 by OriginalGriff
The question is, where are the images? If they are on the server, Javascript can't access them because it runs on the Client and has no access to the server filesystem. If they are on the client, where on the client? You are using absolute...
16 Oct 2022 by Dzhud07
Hi there. Working on an extension where DOM trees has to be created on the fly. For example, I have a list of icons, all in #grid2 and upon clicking an icon, the corresponding content is expected to display in #grid1 . But managing state across...
7 Aug 2022 by shaheed harith
I'm trying to make a sketchpad, which is a project from https://theodinproject.com. By default, the sketchpad has 16x16 grid of squares. The squares are expected to change when the user input the number of squares he wants while maintaining the...
3 Jul 2022 by JackF007
I'm tryingto send or post the checkbox element below to express that act as the backend of my app, in my case from the app.js to index.js(express). APP.JS file const checkbox = document.createElement("checkbox"); checkbox.innerHTML = ` ...
13 May 2022 by Member 15627495
Hello Damianroiz ! as far as I understand your request : you want a "notification feature" , am I right ? when users click on one only grid box, a notification will appears. isn't it ? to achieve this feature : - define your container with...
13 May 2022 by Damian Roiz
I am building a grid of link cards corresponding to services, I want the content from this grid to shift aside when each card is clicked to get the description of each service. Therefore I am building a matrix of object containing the content of...
24 Feb 2022 by Member 15545780
I need to set random data-id with two value A y B. I need a script that can do this What I have tried: ....
7 Sep 2021 by Dan M 2021
I have a javascript search function that I am trying to work with DIV's in html, it works with tables and underlined lists. However, I cannot get it to go though the same list of DIV's and searching through the hyperlink text. HTML Search: ...
7 Sep 2021 by Richard Deeming
Your code works fine for me: Edit fiddle - JSFiddle - Code Playground[^] The error suggests that there is no element in the document with id="main_divs". Double-check that you have the same ID in your HTML and Javascript.
30 Aug 2021 by Rin O
I want to set a click event for each list like this: Example 0. use an inline event handlers** Apple Orange
30 Aug 2021 by Richard Deeming
For something like this, the "best" approach is probably to use event delegation: https://javascript.info/event-delegation[^] document.querySelector('.fruits').addEventListener("click", function(event){ const target =...
11 Jul 2021 by DougsSoftware
Hi, What I am trying to do is, when a user pastes an image into my Div, I need the code to automatically post the image back to the server where the code behind can retrieve it. If anyone can help me out it will be GREATLY appreciated! Thanks...
11 Jul 2021 by Richard Deeming
Use a FormData object to send the file via an AJAX request to the server. Using FormData Objects - Web APIs | MDN[^] Using Fetch - Web APIs | MDN[^] document.onpaste = async (evt) => { const dT = evt.clipboardData || window.clipboardData; ...
2 May 2021 by Robert Hieger
I am writing a simple one page app that demonstrates dynamic insertion of DOM elements in a table, and have run into a problem. I have captured all necessary DOM nodes needed for the business logic. The table contains the name, location of...
18 Mar 2021 by Vedavyas Velaga
I am appending a text element in DOM using d3, the function will be something like this someElement.append('text') .text('x') .on('click', function (d: ITag) { const tagToRemove =...
10 Feb 2021 by Federico Arnaudo
Hello guys !! hope you are well ! im trying to to render some pokemon cards with data that i bring from an API (pokemonAPI). Im able to bring all the data that i need from the APi, exept for the type and abilities. But that is not the main...
10 Feb 2021 by Federico Arnaudo
const renderPokemons = (parent,apiResponse) => { apiResponse.forEach((data) => { const parentTemplate = document.createElement('div'); parentTemplate.innerHTML=`
18 Aug 2020 by Isaac Sogunro
I created a dynamic horizontal navigation bar from a array of objects. As my navigation items are getting rendered on the page, it's also linking each item. The issue I'm having is if the item has a drop down. I'm unable to do so. So for...
18 Aug 2020 by Sandeep Mewara
The reason is you just add text in case of high level menu item as dropdown. You would need to pass on the url of main menu while making the sub menu build. During this, add the url to main menu too. I have modified a little to show that,...
6 Aug 2019 by honey the codewitch
A parser generator and unification system for different parsing tools
26 Feb 2019 by F-ES Sitecore
It's because your function is static. Either make the function non-static, or pass the object in as a param to the function and use it from there. Static functions exist at the type level however your page is an instance of your type. If you have five instances of your page then each page has...
26 Feb 2019 by Member 14159645
Hi everyone, I'm trying to access (and edit) the attribute of a particular in my asp page from the C# code behind. While I can get at it by ID in the main Page_Load section, I cannot access it from a function on the page, which is where I want to do the work. My div:
5 Nov 2018 by thorssig
html2struct parses HTML code into a simple tree-like structure of objects and provides a little tool-set for extracting data from it
3 Oct 2018 by ClockMeister
OK, guys, this one is driving me nuts. I'm doing a little bit of Javascript studying and trying to understand how the JS is resolving this. Here's the code fragment: JavaScript Programmer's Reference
3 Oct 2018 by Richard Deeming
Try using the browser's developer tools. Firefox has a DOM explorer which might help. Alternatively, this online DOM viewer[^] works pretty well. document.childNodes: [0] = [1] = .childNodes: [0] = [1] = #whitespace# ...
1 Oct 2018 by hevhev011717
I needed the destination dropdown list to be dependent on my model's dropdown list. And whenever the user will chose an option on the destination list, textbox and label will be generated. However, I've messed up with my for loop so whenever the user adds a destination, model A.1 and model A.2...
12 Jul 2018 by Gerd Wagner
How to drop a DOM node without consulting its parent
21 Feb 2018 by Silvia Campo
How expensive DOM manipulation can be
6 Jan 2018 by Member 12825432
I i am tryng to make a website that get the car parts of a selected vehicle model, i get the values like the engine, air filter, oil filter and i want to make a table like the one that is on the website that containt this informations. This code works but i dont know how to format a table...
29 Jun 2017 by nmeri17
Whenever an ajax post is made, a full page with html 4 doctype is returned but I want to display that page on the current one. There are also some scripts in the head tag of that returned page that are wrapped in document.ready, which means my options are limited to $.parseHTML i.e. they need to...
29 Jun 2017 by W Balboos, GHB
"Whenever an ajax post is made, a full page with html 4 doctype is returned but I want to display that page on the current one." If you wish to display one HTML page within another, I suggest you use an element. HTML iframe tag[^] "Dumping" one HTML page inside of another is bound...
19 Jun 2017 by arunkx
[ngStyle]="{'position':'absolute','top':field.y+'px','left':field.x+'px','font-size': field.fontsize,'font-family':field.fontfamily,'height':field.height+'px','width':assignWidth(field.width)+'px','border':'1px solid #FFF','background':'#EEE','overflow':'hidden' }" What I have tried: Here, I...
28 Dec 2016 by GaneshRfromSpace
This is my xml file which contains Tamil language scripts. வீடு I am using DOM parser to parse the xml file. ...
15 Nov 2016 by TheAbominable
I have the following: There are some dynamically created tables in the codebehind. Let's say there are 3 tables and we only want to get 1 of them, the first one. We are trying to do this using Javascript.We have a function that...
15 Nov 2016 by Richard Deeming
The innerHTML property returns the HTML between the opening and closing tags of the specified element - the "inner" HTML.To get the HTML including the opening and closing tags - the "outer" HTML - use the outerHTML[^] property.myDiv.getElementsByTagName('table')[i].outerHTML
29 Aug 2016 by bmiller367
jQuery XML Parser and Search
20 May 2016 by Eric Greene
This post serves as an introduction to a series of blog posts on how to build components with React.
12 May 2016 by Member 12520725
I want to get headings h1, h2 from a word docx file with the page number from where it is fetched. e.g. there are headings "heading h1" and "heading h2" in page 1 and other h1,h2 headings on other pages. I want to get these with the page number they are fetched from. Can be something...
2 May 2016 by Android on Intel
In this article, I will talk about applications’ good performance and three developers’ behaviors that prevent it.
20 Apr 2016 by Member 11128987
The problem is when I parse the XML from the original link for example (i am not posting the original link due to securit purpose) like http://example.com/ss.svc/APIabc?A=10&Key=XXXXX&From=19&To=221&Date=19-Apr-2016 then listview is not populated and the the logcat says error thisLogCat...
18 Jan 2016 by ZurdoDev
As Richard said, you need to do what the error tells you. You are using Mutation Events somewhere in your code. Those are not allowed anymore (deprecated). The error is telling you to change your Mutation Events code to use MutationObserver instead. If you are unfamiliar with the...
17 Jan 2016 by prapti.n3
Use of Mutation Events is deprecated. Use MutationObserver instead.This is the error that I am getting. Please help me out what to do?My javascript and jquery are not working.
23 Dec 2015 by nmeri17
Hey there and compliments of the season. I'm trying to pop strings off an array into an element with id "firstPara" but only on scroll. I also want the strings to be popped on interval. Here's my codevar firstString = ["This ", "is ", " me."]; var firstPara =...
14 Dec 2015 by Suvabrata Roy
Hi, You are trying to invoke an client side function from the server side?SingalR would a good tool to do so apart from reflection.ORYou could add script which will call that click function on page loadExample :...
13 Dec 2015 by Umer Qureshi
Create your own web scraper using node.js
12 Dec 2015 by RamanaReddy V
Note: I am getting particular html element with help of page scrapingbut unable to perform click action on that particular element. i aminvoked events like onmouseup,onmousedown,Onclick,click etc... but itcant be working. can u suggest me? HtmlElement dropdownId =...
10 Dec 2015 by Gerd Wagner
Don't confuse a DOM collection with a JS array: Array functions, such as the forEach looping method, cannot be applied to a DOM collection!
20 Oct 2015 by Member 12073897
Your assignment is to take the following html file and implement the code necessary to take the XML file (events.xml), extract the events from the XML document and finally display the extracted information in a table you will create using DOM methods. Once you’ve created the table, you will...
20 Oct 2015 by Krunal Rohit
Homework.Your post says, "Google for Array.prototype.sort", but did you ?First, not a question at all.Second, you tried anything so far ?Third, if you did, where do you stuck ? What's the error ? Any exception ?Please read this Code Project Quick Answers FAQ[^]-KR
6 Oct 2015 by Gerd Wagner
The proper way of creating an HTML table with JavaScript and inserting it into the HTML body element is using the DOM methods insertRow and insertCell.
29 Sep 2015 by David Catuhe
This article is the first in a series that will take a detailed look at one specific feature of Vorlon.js, starting with one of the biggest: the DOM Explorer.
25 Jun 2015 by David Catuhe
Vorlon.js is powered by node.JS, socket.io, and late-night coffee. I would like to share with you why we made it, how to incorporate it into your own testing workflow, and also share some more details into the art of building a JS library like it.
11 Jun 2015 by DamithSL
try htmlagilitypack[^]. you can install it as nuget package[^].sample code:HtmlWeb web = new HtmlWeb();HtmlDocument doc = web.Load(url);var liOfTravels = doc.DocumentNode.SelectSingleNode("//div[@id='myTrips']") .SelectNodes(".//li");
11 Jun 2015 by Member 11530690
I have a working statement in PHP using the simple dom parser that I want to convert into C# using the HTML Agility Pack.I am really struggling and have not been able to get anything even close to working. Here is my PHP DOM Parser code that I want to convert to C#:
11 Jun 2015 by Paul R Martin
A Tutorial on Mustache Templates
19 May 2015 by Member 11703322
I've tried to edit the image src from a webpage I want to show on my own webpage, like this: $imgs = $doc->getElementsByTagName('img');foreach($imgs as $img) { $img->setAttribute("src", "http://www.futwiz.com" . $img->getAttribute("src"));}But it shows up on the view source...
10 Apr 2015 by Gerry Softman
My goal is to recover data file download information from a 'GridView' of a Web page (.aspx).When I active the inspection function (F12) and access to URL I can see the information I need in the 'GridView' as show below:
13 Mar 2015 by Paul R Martin
Using functional programming techniques in JavaScript to add rows to a table
7 Mar 2015 by phil.o
XmlTextWriter[^] is defined in System.Xml namespace. Did you import it? More precisely, do you have aImports System.Xml near the top of your .vb file?If you do not want to import this namespace, you have to use the fully qualified name of the class to use it:Dim tr As...
7 Mar 2015 by Dave the Golfer
Hi AllI have loaded an Xml file as a DOM called myPlayersDOM. I now want to add a new player to the Xml file. I have used this code.Private Sub Players_List_Update(curComboItem As String, curTeleNo As String) MsgBox("Adding Player to file") Dim newPlayer As Xml.XmlElement =...
16 Jan 2015 by Richard Deeming
These StackOverflow threads have a decent explanation:Do DOM tree elements with ids become global variables?[^]Is there a spec that the id of elements should be made global variable?[^]Why don't we just use element IDs as identifiers in JavaScript?[^]Basically, Internet Explorer...
16 Jan 2015 by Jose A M Pacheco
[Google Translate]I made a page with only the following: before the console.log (cpf.value); // "Anything"&lt/ script>tested in chrome 36; IE11 and latest version firefox and it worked in all of them.Because this work?This...
15 Sep 2014 by yno1
im working on a content script in chrome and after several hours of trying to debug a strange problem that caused my current tab to crash, i'm still quite puzzled. it seems that this piece of code runs without crashing the tab:for (var id in newDeleted) { var nameTile =...
8 Jul 2014 by sachi Dash
This is my code. By using this code I can export all the table in excel. But I can not export css class. As a result the color and style is diplaying in webpage do not shown in excel. Can anyone help me by provide a right solution. How can I export the css Worksheet...
6 Jul 2014 by teoska
THE THREAD CAN BE CLOSED.I've solved the problem.:)
2 Jul 2014 by teoska
Hello,I hope here is somebody who knows and uses Dom4j library for Java. I have an assignment for tomorrow, but have achieved almost nothing. So, I need your help.Using Dom4j library, I am asked to parse an HTML document, then create a .dot file for its DOM tree. This file in DOT...
5 Jun 2014 by Steve Wellens
Lurking in the shadows of the Stack Overflow website, selling aerosol cans of Bug-No-More to the rubes, I came across a question I thought I could answer.
13 May 2014 by leotato008
Gotcha! Added these lines inside the web.configI had trouble understanding where I had to put these lines.Thx Matej!
12 May 2014 by leotato008
Hi guys!Trying to parse an xml using jquery.This seems to work only With IE 11 (didn't try older releases). Chrome, Opera and Firefox don't do anything.. if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } ...
10 May 2014 by Manas Bhardwaj
Did you try Reference Directives?Quote:A reference directive enables Visual Studio to establish a relationship between the script you are currently editing and other scripts. The reference directive lets you include a script file in the scripting context of the current script file. This...
10 May 2014 by leotato008
Hello Guys!I've just begun working with JS in VS2013 premium. No problems about coding, but I think I'm missing something.Intellisense doesn't show all of the methods I'd expect.To clarify.. I have a reference to an external js file that loads an XMLDoc.Then I try to traverse the...
6 May 2014 by Coder93
I want to cache xml DOM of a page in localstorage, I store it in an array and convert it into a json string, but i get this error : "Uncaught TypeError: Converting circular structure to JSON "how can i do this?[EDIT]I load an xml file as follow : xml =...
6 May 2014 by Sergey Alexandrovich Kryukov
Thank you for the clarification.The exception is unrelated to localStorate; you are trying to use it correctly.The exception is thrown by JSON.strignify. This type of serialization does not support data graphs with circular references (some technologies, such as .NET Data Contract handle...
30 Apr 2014 by TorstenH.
how about newElement = doc.createElement("SHORT-NAME");attribute = doc.createAttribute("xsi:type");attribute.setValue("VALUE");newElement.setAttributeNode(attribute); does that work?
29 Apr 2014 by Naveen Kinnal
Hello,I am trying to create an attribute and set its value as,newElement = doc.createElement("SHORT-NAME");newElement.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xsi", "http://www.w3.org/2001/XMLSchema");attribute =...
29 Apr 2014 by TorstenH.
Read each XML-File: http://www.mkyong.com/java/how-to-read-xml-file-in-java-dom-parser/[^]put them in new XML-File: http://www.mkyong.com/java/how-to-create-xml-file-in-java-dom/[^]You might want to add all nodes to a list, so you can sort them before writing the new XML File:...
28 Apr 2014 by Naveen Kinnal
Hello,I have two nodelists which has some common elements in it.I need to get all the common elements from the two nodelists and put it in another nodelist.How can this be done using DOM parsing strategy ? Please help me out.
15 Feb 2014 by BrianHamilton
Hi,Assuming I dynamically create a paragraph and then create a text node and append it to the paragraph. It is easy enough to prove code wise the text node is a child of the paragraph. However, if I style (setAttribute) the text node before using appendChild to append it to the paragraph...
5 Feb 2014 by CoderPanda
I am trying to programmatically get the last modified date of a webpage or site. The site can be static or dynamic. The site in question is not my site, which means I do not have any control over it. It can be a news site, a blog, a static ad site... anything.Is it possible to do this using...
3 Feb 2014 by abdul subhan mohammed
Your answer is here:Use flags
2 Feb 2014 by joginder-banger
may be this link solve your problem.http://stackoverflow.com/questions/5235351/how-can-you-mine-the-last-modified-date-for-an-asp-net-page-which-is-based-on[^]
19 Nov 2013 by Brad_Davis
Angular: The DOM API You Have Been Waiting For
18 Nov 2013 by mitchiee1226
I have this Table that is generated via JavaScript. I want the values to be cleared every time the program goes to it.function loadHistory(itemlist) { if (itemlist != null) { var gridView = jQuery("#GridView1"); jQuery(".GridviewScrollItem").remove(); ...
8 Nov 2013 by Member 10389705
I have an XML file which looks like this. Crypto ABC Encryption String float
11 Oct 2013 by ASP.NET Community
IntroductionSharp DOM is a view engine for ASP.NET MVC platform allowing developers to design extendable and maintenable dynamic HTML layouts using
21 Aug 2013 by Jitendra Sabat
Button and container div markup is given byScript add dynamic markup is as followsvar dynamicMarkup=''+ ''+ ''+ 'Lubomyr Pelyo'+ ''+ ''+ 'First record in news'+...
21 Aug 2013 by Taras Krutiak
Моя тобі порада задавай такі питання ТУТ.А по питанню спробуй використати appendChild()
13 Aug 2013 by Lubomur
Upload an image:
28 Jun 2013 by Lubomur
if someone interest if(textTrim != ''){ var newsDiv = document.createElement('div'); newsDiv.setAttribute('class', 'news'); var img = document.createElement('img'); img.setAttribute('src',...
28 Jun 2013 by AspDotNetDev
So you aren't sure how to make a bunch of nested DOM elements? There are many ways:jQuery. You are using jQuery, which can readily create DOM elements using HTML strings, like this:var newsDiv = $("...and so on...")[0];Copy. You can...