Most voted "dom" questions
DOM (Document Object Model - Document Object Model) is a W3C specification for a platform and language independent interface, where one can dynamically change and edit the structure, content and style of an electronic document, allowing the document to be later processed and the results of that processing, incorporated back into the document itself.
Learn more…268 questions
Sort by count of
-
1
votes1
answer688
viewsPHP Simple HTML DOM Parser works without id or class reference?
I want to use the PHP Simple HTML DOM Parser to remove certain links from a page generated in Frontpage the problem I found is the following as Frontpage does not generate any html element with id…
-
1
votes1
answer102
viewsHow to keep a Javascript Function in the DOM even after a page load from another page?
As far as I know it is not possible to keep the state of the DOM even after the page load, there is some technique or some way out to keep the Function in cookie or Storage(local, Session) to give…
-
1
votes1
answer3262
viewsTake the value of the input closest to a button
Given the code below, how do I get to button.like or button.dislike, in the value of input#avaliacao_item_id (2) by jQuery? <td> <button type="button" class="btn btn-primary btn-md…
-
1
votes1
answer77
viewsHow do I know which script manipulated a gift and modified the HTML attributes?
It is possible to know through the console? Imagine this story: You have several Javascript files embedded in the page header, and when you send a post, out of nowhere appears a style="display:None"…
-
1
votes1
answer422
viewsPick CSS class from other sites using PHP HTML DOM Parser
I’m trying to get a class from a news site, but I’m not getting it. $titulo = $html->find('feed-post-body-title gui-color-primary gui-color-hover', 0) ->innertext; echo $titulo; You’re making…
-
1
votes1
answer485
viewsTake value from a Span field with Curl Parser
I have a question and a problem. Good is the following with Curl I login beauty so far everything well.. but I need to get some information inside the html: <span…
-
1
votes1
answer92
viewsHow to create gift without javascript?
I wonder if a web browser, as well as firefox, Chrome etc uses javascript to make gift in html! So, is it javascript that does the gift in html? Like this, when the browser does the rendering it…
-
1
votes3
answers641
viewsCheck if window load is false
When I give the command: $(window).load(function(){ console.log('Site totalmente carregado!'); }); Works correctly, the message on the console only appears when the window has been fully loaded. But…
-
1
votes1
answer450
viewsIn which programming language does a Crawler/scrapper scan the DOM faster?
I developed a script in which I use the class DOMDocument PHP to make a Crawler on a third party website. The speed of script does not meet the expected goal, I would like to know in which…
-
1
votes1
answer89
viewsDomxpath find element with exact name
I’m having a problem trying to find an element with the exact name. <? //... @$DOM = new DOMDocument; @$DOM->loadHTML($html); @$finder = new DomXPath($DOM);…
-
1
votes1
answer112
viewsShould I keep the void on the link or can I leave it blank?
I’ve seen some links that contain the following syntax: <a href="javascript:;" id="el" onclick="acao()"> As far as I know, in some versions of IE, this causes a mistake, so I ask if I should…
-
1
votes1
answer126
viewsRemove class and change value Aria-Hidden by clicking on the body
There is a project in the code pen called "Flex Priority Menu #1.2" is a magnificent menu that when it has many links or the window "resized", it goes hiding and putting in a dropdown [More...].…
-
1
votes2
answers71
viewsModify an HTML element or a browser native function
Guys, next... Google Core supports the element <dialog> and its functions showModal() and close(). However, some browsers do not support it. I made a simple script, which checks whether the…
-
1
votes1
answer186
viewstransition between main container to a new Javascript container using DOM
Hello, I have a function in Javascript using DOM to create a page and then I intend to view this page on container and for this the visualized data would have to be just the intended and only that…
-
1
votes1
answer76
viewsWhat is the compatibility with the browsers of using the tag template?
Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template Example of use: Javascript: window.onload = function() { var contentHTML = document.getElementById("teste").content; var…
-
1
votes1
answer309
viewsHow to use querySelectorAll() to search for a specific tag derived from an element that has an x class?
Someone could help me use the .querySelectorAll() to find all paragraph elements derived from items that have a classe x?
-
1
votes0
answers468
viewsDocument.getElementById does not find element manually inserted in the DOM
Hello, I’m having a hard time getting an element through the id of a Class with document.getElementById(id) of DOM using Javascript and I have a panel style in css #painel { text-align: center;…
-
1
votes1
answer27
viewsReread tags scripts and style with js
I have these tags scripts that serve to adjust and give functions to a carousel. However I am adding the carousel as soon as I click on a button, however as the page has already been rendered these…
-
1
votes1
answer94
viewsHow to ensure that an element will have the DOM event?
Good afternoon, Today I am facing a rather strange bug in my application: I have a textarea field where I type a body of email and just below it a button that when clicked obtains the content of the…
-
1
votes2
answers1775
viewsHow to remove all elements from a javascript div?
How to remove all elements of a div at once removeChild() removes only one element?…
-
1
votes1
answer903
viewsGet PHP DOM attribute value
I’m trying to make an application to take certain values from a page and insert them into a page of mine. I don’t know how to program, but I’m still taking a risk, because it’s to improve my…
-
1
votes2
answers45
viewsHow do I increase a CSS property using Js?
I’m needing that every time I press a button, a CSS property increases by 10, example: <style>div { left: 0; }</style> <button>Aumentar left em 10</button>…
-
1
votes1
answer88
viewsHow to put multiple JSX expressions on onload in React
Is there any way to put two JSX expressions on onload? Every time I try to put two expressions he doesn’t recognize the second expression. I wanted to try to put it this way : <td onLoad={e <…
-
1
votes1
answer44
viewsJavascript, why only Document has the getElementById() method?
The query is simple, because javascript only allows calling the getElementById() method at the root of the DOM tree? In other words? because only the object Document has the getElementById method().…
-
1
votes2
answers665
viewsWhen using jQuery append displays the text [Object Object] and does not insert the element
I created a div.box in html and I want to insert another div that I create in the execution of the code, follow the avaixo: HTML: <div class="box"></div> JS: var item = $('<div…
-
1
votes1
answer121
viewsRecreate HTML elements from one Div to another Div by Classname
Well, some will suggest me using the cloneNode(true) Javascript to make a appendChild(var) in the GIFT. But for this case, I have used this native resource, but it did not meet my need. Why, when I…
-
1
votes0
answers86
viewsJavascript DOM Parser incompatible with Document?
My idea with the DOM Parser was to load HTML layouts, place them in a single element, and then use them when necessary. But in tests, the object generated by DOMParser not added to Document. See the…
-
1
votes2
answers414
viewsProblems with contact form 7 - obsolete on_sent_ok function
I have some forms using the plugin contact form 7 and each one redirecting to a specific success page, I used on_sent_ok, however it does not work I went to check and found that it is obsolete and…
-
1
votes1
answer434
viewsWhen can the setSelectionRange method of Htmlinputelement be used?
Studying the structure of an element HTMLInputElement I arrived at the method setSelectionRange, selecting the text from the positions defined by the parameters, i.e. input.setSelectionRange(0, 8)…
-
1
votes1
answer30
views"Less" value is removed
Hello, I made an application to run locally in PHP, but I want to give an increment, so that it is faster. I’m not a programmer, I made this application, looking at some examples on the Internet. I…
-
1
votes1
answer2242
viewsHow can I create an edit button to edit a dynamically created table in Java
<!DOCTYPE html> <html> <head> <title>Tabela dinamica</title> <link rel="stylesheet" type="text/css" href="css/css.css"> </head> <body> <form…
-
1
votes2
answers188
viewsRemoval of elements in the DOM with removeChild()
I’m starting with javascript, from scratch, I have this exercise where the goal is to add and remove city names in an html list. I know little about DOM. The insertion part already works, but the…
-
1
votes1
answer32
viewsI cannot update the value of a String by clicking on a certain button
I’m doing a calculator project and I’m not able to update the screen when someone keystrokes the number 7, for example. Here’s the code: HTML: <html lang="en"> <head> <meta…
-
1
votes1
answer902
viewsConvert a code to jquery for pure Javascript
I have a jquery code that would like to convert it to pure javascript, DOM. Can anyone help me? var mobileItems = jQuery( '#slide-out .nav-mobile .main-menu' ); mobileItems.find(…
-
1
votes1
answer366
viewsHow jquery events work
I will show examples only of the click event to be simpler to explain, but this is related to any jquery event. When I started using jquery I only used the click event as follows:…
-
1
votes2
answers246
viewsDisplay contents of the "title" attribute next to the option element
I have a thumbnail set of images on option of select. I would like the script automatically enter the caption for each of these images in the select, based on attribute title of tag option. The…
-
1
votes1
answer976
viewsHow to insert dynamic lines in HTML table, and already define a class ante-hand
I have an HTML table and I am creating your lines dynamically using appendChild(), I just can’t seem to define className dynamically on these lines, in the third column - "VALUE". See how this: var…
-
1
votes1
answer59
viewsAutocomplete does not work on adding remove inputs
I am developing a quotation form and in it I add and remove lines to register products and in each line there are two autocomplete fields, where search the product by code or by name. The first line…
-
1
votes1
answer81
viewsDuplicate element in DOM with JS
I need to add a <li> via Javascript, but when added, from the second addition, it starts to duplicate, triple and so on, I need you to add only 1 element per click. var btn =…
-
1
votes2
answers92
viewsIs there any way to format an entire row while finding word on page
The idea is this.. when I call a function that brings values from a string included in the script I want the word(s) (s) to begin as an example: & Neutral Colors If highlight of the others,…
-
1
votes0
answers24
viewsElement without properties
See the following code snippet below: var element = document.getElementById('myDiv'); console.log('element: ', element); console.log('has tagName property: ', element.hasOwnProperty('tagName'));…
-
1
votes3
answers53
viewsHow to display the current date while loading the page
I’m willing to display the current date on a particular div while loading the page, I have already made a working sketch of the code, but I am using the button. I followed the code: function…
-
1
votes2
answers289
viewsHow to join different foreach results in an array?
I’m picking up information from movie posters from a movie site, using Simple Html Dom. <?php include("simple_html_dom.php"); $html = file_get_html("http://arcoplex.com.br/?lang=059"); To get the…
-
1
votes0
answers449
viewsEnable/Disable input by clicking a checkbox
I have this code: function EnableDisableTextBox(quant_a0) { var txtquant_a0 = document.getElementById("quant_a0"); txtquant_a0.disabled = quant_a0.checked ? false : true; if (!txtquant_a0.disabled)…
-
1
votes1
answer191
viewsWhy would it be interesting to add or remove HTML element from the DOM?
I am starting my studies in Angular 7 and in a class on Structural Directives, I learned that I can add or remove elements HTML of DOM. I understood that there are 3 main, the ngIf, the ngSwitch and…
-
1
votes1
answer58
viewsAlerts the user that he did not choose a type=radio;
I’m having a problem not knowing how to identify if the user has selected an option type=radio. Follows the code: let nComputador = ""; let nJogador = ""; //let minhaEscolha =…
-
1
votes3
answers220
viewsWhy "Domcontentloaded" only works after Ctrl+F5
I have some problems with document.addEventListener("DOMContentLoaded" in the following section. I can only get the values of list when I activate the Ctrl+F5. I need to have it when first loaded. I…
-
1
votes1
answer84
viewsReturn the value that is clicked from an array in a Function. I only know how to do using Event.target
I want to return the value that is clicked, from the array. I know how to do this only with add.Eventlistener. In the case e.target. <h2 onclick="menuclick()" class="notselectable…
-
1
votes1
answer440
viewsAdd child element before other
I’ll explain: Assuming I have the following code: const filho = document.createElement('li') const text = document.createTextNode('Filho 0') filho.appendChild(text)…
-
1
votes0
answers110
viewsLoop a javascript DOM element - Each element in a <li>
I am developing a memory game and the icons they are not going one for each li but every loop appearing one more icons in the corresponding li. In the last li appears 16 icons instead of a. const…