Click here to Skip to main content
15,894,343 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 Feb 2014 by abdul subhan mohammed
Your answer is here:Use flags
28 Sep 2011 by Alexander Chernosvitov
AntiBot control using HTML5 rotating feature
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...
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...
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 May 2016 by Android on Intel
In this article, I will talk about applications’ good performance and three developers’ behaviors that prevent it.
12 Jun 2013 by Anshu Krishna
kLib: A small library to make DOM operations very easy.
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...
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
20 Sep 2012 by Ashraff Ali Wahab
$('h4').each(f...
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
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...
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 Aug 2016 by bmiller367
jQuery XML Parser and Search
19 Nov 2013 by Brad_Davis
Angular: The DOM API You Have Been Waiting For
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...
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 .
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
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 =...
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...
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...
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");
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: ...
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...
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...
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 =...
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.
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...
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...
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...
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.
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...
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=`
20 Sep 2012 by fjdiewornncalwe
I believe you need to use .text(), not .html() to get this value.
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. ...
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.
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!
12 Jul 2018 by Gerd Wagner
How to drop a DOM node without consulting its parent
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:
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...
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...
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...
12 Feb 2013 by gouravkaila
Although i have done all this, somewhere using synchronous Ajax calls also..but that is the worst i could do.
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
21 Feb 2013 by H.Brydon
(haven't tried it) I think you might be able to do this with innerHTML property.
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...
6 Aug 2019 by honey the codewitch
A parser generator and unification system for different parsing tools
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
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...
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 = ` ...
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'+...
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[^]
27 Jun 2013 by Jon Woo
Consolidating all the information that I have found on cross domain interaction in the web world
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...
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...
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
26 Sep 2012 by Kuthuparakkal
try:Dim oNode As IXMLDOMNode For Each oNode In oItemNodes Set sPMIDNode = oNode.selectSingleNode("/PMID") If Not sPMIDNode Is Nothing Then sPMID = sPMIDNode.Text Set sTitleNode = oNode.selectSingleNode("/ArticleTitle") If Not STitleNode Is Nothing...
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 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 =...
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!
28 Jun 2013 by Lubomur
Hi, I want to create some code on button click using javascript and jQuery,those code look: Lubomyr Pelyo
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',...
13 Aug 2013 by Lubomur
Upload an image:
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...
8 Nov 2013 by Member 10389705
I have an XML file which looks like this. Crypto ABC Encryption String float
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...
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#:
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...
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...
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...
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...
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:
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: ....
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...
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!
22 Sep 2012 by Member 9444740
here is the code: $(document).ready(function (e) { $('#submit').click(function (e) { try { var $inputTxt = $('#search'); result = $inputTxt.val(); alert(result); $('p').each(function () { var...
20 Sep 2012 by Member 9445358
I am trying to use javascript to search the html text on a website. In order to do this I am using the dom tree. i wrote code to look at the html contained in a h4 element, and i can see that it found all 6 headers(d.length alert), and using chrome, i can see the textContext of each is what i...
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...
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:...
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(); ...
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 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 =...
17 Aug 2011 by neera757
I have taken two iframe in browser. in one iframe i have have open pdf, and in other iframe i have taken a textbox contained page. when i am doing drag drop is working but i am not able to fetch the selected text into string on clientsite using javascript. as everybody knows well that DOM does...
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?
18 Dec 2011 by NguyenVanDuc
Hi all!I have an problem with my project:i want remove the first class in my dom: My code is duplicate, so i...
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();
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 =...
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...
1 May 2013 by nureza_fachry
I think is 'length' instead of 'Length' = for (var i = 0; i
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...
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...