Click here to Skip to main content
15,886,844 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 Score

DOM 

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!
29 Aug 2016 by bmiller367
jQuery XML Parser and Search
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.
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.
19 Jul 2011 by Sergey Alexandrovich Kryukov
If I understand this right you mean selection with the mouse, something you do before the clipboard "Copy" operation. The problem is: such selection does not select any certain node. It selects a fragment of the document in its rendered form, not DOM; such selection goes across the DOM nodes of...
12 Jan 2012 by South 305
I would like to MONITOR an HTML control (HtmlElement) inside a WebBrowserControl. I would like to add EVENTS to the control in order to be notified whenever any EVENT got call(fire) on that control.To simplify my needs here are 3 questions assuming the following single line of code: var...
30 May 2013 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Sergey Alexandrovich Kryukov has provided you one solution to use insertBefore, which will solve your purpose.I have created one Demo for you using that insertBefore to do your task.Take a look - [Demo] Javascript help in ordering elements created in DOM![^].
27 Jun 2013 by Jon Woo
Consolidating all the information that I have found on cross domain interaction in the web world
6 Apr 2011 by Pete O'Hanlon
Basically different browsers treat the same markup in slightly (or radically in some cases) different ways. What you are being advised here is to ensure that your browser is capable of creating a Document Object Model (DOM), which is similar to the DOM provided by a browser. If I were you, I'd...
10 Jan 2012 by SvenMe
First of all, this is probably not the kind of answer you'd expect.As far as I understand your problem, you're trying to automate the process of forwarding an e-mail, isn't it? What are you doing in case Google decides to change their layout?In my opinion it would be better and hopefully...
12 Jan 2013 by Thomas Daniels
Hi,Try changing this: XmlElement novDatum = newDoc.CreateElement("datum"); novArtikel.AppendChild(novDatum); XmlElement novNabave = doc.CreateElement("nabave"); novNabave.InnerText = a.datumNabaveA; novDatum.AppendChild(novNabave); //HERE RAISES AN EXCEPTIONinto this:...
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...
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'+...
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...
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
12 Jul 2018 by Gerd Wagner
How to drop a DOM node without consulting its parent
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# ...
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...
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; ...
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 =...
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...
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...
14 Jul 2011 by Amir Hossein Farhangi
Hi,I have the source codes (html codes) of a web page in a string variable. I just want to get a DOM tree of those html codes. I used HtmlDocument class and it has HtmlElement-s but it seems it's not tree structured. And I don't know how to use HtmlDocument.DomDocument (MSDN didn't...
14 Jul 2011 by Salmen Essridi
I think that the Html Agility Pack will be useful for you.http://htmlagilitypack.codeplex.com/[^]good luck.
19 Jul 2011 by Amir Hossein Farhangi
Hi, is there any way to get the selected DOM node when we select a part of a web page in WebBrowser control?
2 Sep 2011 by Rupesh Kumar Tiwari
If they are of different domain then because of Same Origin Policy, you will not be able to access the content of Iframe. If both the iframes are pointing to same domain then i can suggest you the code to access the content of the iframe.
19 Dec 2011 by saini arun
jQuery's "unique" function may help you here.link[^]
2 Jan 2012 by NguyenVanDuc
I'm using .slice() and .remove() of Jquery.$(".a").slice(0, 1).remove();--> Remove only the second div with class ".a"$(".a").slice(a, b).remove()--> Remove all div with class ".a" from a to b.$(".b").slice(0, 1).remove(); $(".c").slice(0, 1).remove();
10 Jan 2012 by South 305
I'm trying to FORWARD and email from GMAIL using the WebBrowserControl (C#). -I am able to open the Gmail INBOX page on the WebBrowserControl... -I am able to OPEN the specific email (among the others on the inbox) that I need to forward... -I am able to find and click the...
1 Mar 2012 by TaylanCirkinoglu
Hello,I have designed a browser and want to check if my browser supports all of the html 4.01's specifications.I want to check if there will be any problems displaying any kind of html4.01 code.How to do this? Any suggestions?Taylan
1 Mar 2012 by Sergey Alexandrovich Kryukov
This is a problem: you cannot determine it on the fly. Besides, there are too many different versions of even the major browsers and nearly all of them have some incompatibility. You can find some reference material, but ultimate results can be achieved only through testing. Cross-browser...
19 Apr 2012 by giova85
Hello i was looking to find a solution for this problem but seems difficult. I have appengine project working with a servlet that handle registration. When i try to call this servlet i have this log report:012-04-19 10:31:06.816 /register 500 90ms 0kb Apache-HttpClient/UNAVAILABLE (java...
20 Sep 2012 by fjdiewornncalwe
I believe you need to use .text(), not .html() to get this value.
20 Sep 2012 by Ashraff Ali Wahab
$('h4').each(f...
22 Sep 2012 by Member 9444740
I am trying to highlight (temporarily) words in html. I can successfully edit the text content so that the tags are in the correct place in the text string, and it appears I am saving the edited string correctly, BUT....the text displayed in the browser does not change!
15 Oct 2012 by newbie@work
-1,-1,-1How can I read the multiple -1 values using the Gettext method?
21 Oct 2012 by newbie@work
I created a DOM document. After performing my tasks with it is there any need to Release it? And if yes, then how?HRESULT hr =spDoc.CreateInstance(__uuidof(DOMDocument40));This is how I declared the document. How to Release?
7 Jan 2013 by inguva suryanarayana
how can i access and manipulate the Dom of an webpage using unmanaged c++ and also i would like to know the library file and methods for it. pls provide me any link . i am new intern
7 Jan 2013 by chandanadhikari
hi,Hope this helps here[^]This is a list of scripting object interfaces for MSHTML . Also go through other links on this page .you need to further use google to search for code samples or examples .
12 Jan 2013 by vezo11
Hi,i have tried, but the same effect. Exception signals on the same line:novDatum.AppendChild(novNabave);Thanks for the reply.
30 Jan 2013 by gouravkaila
Dear All,I need urgent help as i am unable to refresh the HTML of my .aspx page after a code behind call(using Ajax)to the same page.I am calling the code behind via ajax on the selectedindexchange of a dropdown.In that code behind,I am loading and setting some properties of another...
30 Jan 2013 by Shubhashish_Mandal
In that case no need to refresh the page. Because of if you refresh the page then the purpose of using ajax is meaningless.Instead create the list in javacsript.There are two way to create element.1. creating the element object see this 2. Creating the innerhtml for select see this...
30 Jan 2013 by Shubhashish_Mandal
you can try location.reload() to refresh the page . take a look
11 Feb 2013 by Daroosh
Hello everyone. I am simply trying to build a Chrome extension which waits for a webpage to load then, gets access to its DOM model an finally manages to modify it by injecting scripts at certain parts of the page. The extension is meant to be a page_action since i am planning to run it on...
11 Feb 2013 by Daroosh
I finally managed to reach a solution which fits my case. I added the following line of code to my .js file.$(window).bind('hashchange', fooBar);This way, everytime the URL of the page changes, the function fooBar is called. This event is only triggered after the page's DOM is completely...
12 Feb 2013 by gouravkaila
Dear All,Although i have already asked almost the same questions in past also,But I am still not clear about following thing in AJAX partial postbacks and partial renderings.I have a few straightforward questions that are still annoying me...1) I have multiple frames on my page. Can...
22 Feb 2013 by Member 9829514
Hi All,Looking to create a DOM in HTML from aload of HTML. I currently have a program that is capable of getting the HTML from a website and dumping it into a textbox. from this i was to create a DOM. Anyone have any ideas... this looks perfect.... HTML DOM Using...
22 Feb 2013 by Richard MacCutchan
If you use the WebBrowser Class[^], then you can get the DOM direct from the Document property, which is an instance of the HtmlDocument Class[^].
22 Feb 2013 by Richard MacCutchan
This code gets the HTML from a control that is inherited from WebBrowser, and uses the DOM to find particular tables and items within it.// logout from 3RingsHtmlElement element = Document.GetElementById("directory_list");// get the table header collection (one...
29 Apr 2013 by BinaryPAx
Hi everybody : i've been trying to script an svg file that with some basic javascript.to change the border color of an svg element ( a path ), using the event onmouseover(), but the problem i'm having is that the code doesn't even get executed. Here is how my code and my svg file looks...
29 Apr 2013 by Graham Breach
There are a couple of things that you have to fix here. The first is a missing ]]> at the end of the script block to close the
1 May 2013 by Alireza_1362
Hi ,I'm trying to write code in vs 2010 ,so whenever I go to one of the links on my page by the mouse ,it can show me a div tag ,which it's content is loaded by ajax call from other html files (these html files contain only p tags,but It doesn't work ,even I try to track my code by firebug ,but...
1 May 2013 by Karthik. A
Where is the PreviewLinks.js file located? In the same location as your aspx page? If not you will have to specify the complete relative path like:If you look in to the script errors section of your browser's developer tools, you will find 404 errors. This indicates that the web...
1 May 2013 by AshishChaudha
Function MakeRequest(evt) have an argument evt and you are not passing any any thing in following line allLinks[i].onmouseover = MakeRequest;I think there is a problem in that.hope it helps youThanks
1 May 2013 by nureza_fachry
I think is 'length' instead of 'Length' = for (var i = 0; i
30 May 2013 by digi0ps
Hey everyone,I am creating a js file for taking input and posting the contents in the webpage.Here is the source code:Posts function...
13 Aug 2013 by Lubomur
Upload an image:
20 Feb 2013 by Daroosh
Hello everyone. I am trying to copy the complete content of one IHTMLDocument2 to another new instantiated copy of IHTMLDocument2. In pseudo code, it would be something like this:IHTMLDocument2 newDoc.content() = oldDoc.content()The reason why I'd like to do so, is simply that whenever a...
21 Feb 2013 by H.Brydon
(haven't tried it) I think you might be able to do this with innerHTML property.
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
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...
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[^]
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...
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.
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:...
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 =...
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?
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...
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...
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(); } ...
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!
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...
6 Jul 2014 by teoska
THE THREAD CAN BE CLOSED.I've solved the problem.:)
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...
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 =...
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...
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:
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 :...
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.
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...
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...
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.
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...
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. ...
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...
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...
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...
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...
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
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,...
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 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 =...
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...
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...
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