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
-
0
votes1
answer71
viewsReinserting elements elsewhere in Body, html and Javascript
I’m trying to store in a var, and then reinsert into the body 3 elements of the type "p". <body> <p> Um</p> <p> Dois </p> <p> Tres </p> .... In doing so:…
-
0
votes1
answer36
viewsAccess one-page classes, id’s, div’s with my extension
Hello, I am writing an extension with the following goal: access the target elements of a page (type Document.querySelector('.Jobs')) and from there write the rest of the instructions. However, from…
-
0
votes1
answer169
viewsHow do I access the DOM elements in the Electron?
I’m new to Electron, and I’m trying to do a function from a click on a menu. Follow my example below. index.html <!DOCTYPE html> <html lang="pt-br" dir="ltr"> <head> <meta…
-
0
votes0
answers50
viewsCopy HTML elements into a form
I want to copy the div clicked, into the form which already contains the select. For example this: var opt = document; function processar(el) { opt.getElementById('minhaLista').innerHTML = el; }…
-
0
votes0
answers22
viewsHow to control events of dynamically inserted HTML elements later
I generated a professional HTML card with Javascript. The list is populated after clicking on the category: var professionalsCards = ''; $.each(professionalsData, function(i, item) {…
-
0
votes0
answers71
viewsDOM slow to respond
Next, I have an application that within the . NET charging is fast, it takes 1,423s for the method to respond, only when it goes to the VIEW it is taking longer... It’s like something is holding the…
-
0
votes1
answer179
viewsLine breaking with Onclick Javascript
I have a function, that when clicking changes an element, but also ends up breaking the line, I tried to solve using the preventDefault(), but without success. When clicked on the icon…
-
0
votes1
answer39
views$.fn.data - jQuery
Well, I’m banging my head on this code, I’m reading a book about jQuery, but I can’t make this code work, someone can give a hint on how to solve it, and what this method works for ($.fn.data).…
-
0
votes1
answer33
viewsSelect custom with conflicting script
So I have a script to change the default select of Woocommerce variations, so far so good, the problem is when a variation is out of stock, the custom select should have the same options as the…
-
0
votes1
answer1309
viewsHow to create dynamic input within form
First of all before you say you already have answers, I looked before and I didn’t find. Next, I want to make one form, with several dynamic inputs where the person chooses a garment in each input…
-
0
votes1
answer99
viewsAdd Elements with Javascript
I’m getting the bug: Uncaught Domexception: Failed to execute 'insertBefore' on 'Node': The Node before which the new Node is to be inserted is not a Child of this Node. When I try to insert one div…
-
0
votes0
answers25
viewsUpdate jquery plugin trigger when updating image via DOM
I made a gallery in HTML5 and CSS3 and inserted a plugin Jquery "Lightgallery" to open the images in larger size as lightbox, there is a large image and several thumbnails, when I click on a…
-
0
votes1
answer26
viewsAccess IIFE function in global scope
Guys, I’m doing some Javascript tests, and I need to access an IIFE function in the global scope, because the element is being created inside it and it does an execution onclick calling a function,…
-
0
votes1
answer422
viewsCreating HTML elements via Javascript/Jquery
Hi! I created an HTML form for a curriculum generator and in the field "professional experience" has only inputs to record an experience. HTML: <fieldset id="professional-info">…
-
0
votes0
answers77
viewsGenerate a table using String and innerHTML template
In one exercise, I was trying to create a table through DOM using template string and the innerHTML command Where I want to insert the td <tr id="boletinAluno"> </tr> Creating the…
-
0
votes1
answer304
viewsHow to pull XML data from the "tag" using Filereader and Domparser? (Nfe)
What am I doing wrong? My intention is to save some information of an Nfe (take the tag data) from an XML, without having to do upload of the same nowhere. Head - <meta http-equiv="Content-Type"…
-
0
votes1
answer102
viewsModal does not load the data that is coming from the database correctly
Good morning. Guys, I got a little problem here. I am showing in the view a table, where if a column has a certain status will show a link to open a model where will be shown the data that are in…
-
0
votes2
answers175
viewsHow to call a modal using javascript or another language that works within HTML?
Hello, I have a modal that has a registration form, when I click to register it calls a code PHP, that registers the information and initiates a session 'done registration. After opening the…
-
0
votes2
answers171
viewsI can’t get content (number) of some tags read
The idea is to take a sequence of values arranged in li’s that share the same class, convert to integer, add to then perform a conditional test. I’m using…
-
0
votes2
answers175
viewsI wonder why this Javascript code is not working (simple program)
var verificador = document.window.getElementById('input#verificador'); var nacionalidade =…
-
0
votes0
answers124
viewsHow to automatically update the attribute value of any HTML element using Javascript?
I need to keep the title of any element on the updated page. Whenever an element has the value of title being the character ?, I want to replace it with the value inside the tags of the same…
-
0
votes2
answers147
viewsHow to perform a query within a nodeList?
Using pure Javascript, I performed the following query: let elems = document.querySelectorAll("a.menu-item, span.menu-item"); After using the items of this nodeList, i needed to use other elements…
-
0
votes2
answers2782
viewsHow to catch the children of an element with Javascript?
I own a <div> with several children, as shown below: <div id="minha-div> <span class="filhos-1" id="filho-1"><!-- outros aqui --></span> <p class="filhos-2"…
-
0
votes2
answers174
viewsCreate stylized HTML element using Javascript
I’m trying to create a red block on the page using HTML, but for some reason the code doesn’t work. The browser console does not return any error and nothing happens on screen. The program is like…
-
0
votes1
answer188
viewsHow to limit the click of a button?
I’m making the settings system of apple Macbook where depending on the settings the price increases on time. But I have a problem where if I click more often on the desired config it keeps adding…
-
0
votes1
answer170
viewsInnerhtml function doesn’t work?
I am using the view engine handlebars, however, when I went to manipulate DOM elements, it continues with the value given to it by the exhaust, follows the code below: monitor page.handlebars:…
-
0
votes2
answers141
viewsHow to remove elements from a javascript list
I’m making a small javascript program to generate a tabulation. To prevent duplicates from occurring, I put in a small code snippet to clear the list before generating the table let numero =…
-
0
votes1
answer42
viewsSettimeout, make the text come out after a while
<div> <input placeholder="Adicionar morador no 1° Andar" type="text" id="name1" style="margin-bottom: 40px;"> <input type="button" value="Adicionar" onclick="adicionarMorador1();…
-
0
votes2
answers149
viewsHow to separate obtained Loadhtml results
Well, I have the following code: <?php $url = 'https://www.zerozero.pt/edicao.php?id_edicao=135716'; $str = ''; $html = file_get_contents($url); //debug purposes //$html = '<div…
-
0
votes1
answer169
viewsKeypress event does not work after $.get() request
I’m developing a php system and I’m using Jquery for Client Side requests. I have a simple routine for processing inputs that does not allow the user to type a non-numeric character. The script…
-
0
votes0
answers298
viewsHow to know when the virtual DOM and real DOM update happens?
I’m developing a project in React and noticed that using multiple setState() followed caused the surrender of my component again, for example: function MeuComponente() { console.log("Componente…
-
0
votes2
answers34
viewsLink Event to TAG Class exclusion
I need to make sure that by clicking the "REMOVE" button the removeChild function removes exactly the product on which the REMOVE button is linked. Currently, everything is fine but I know that in…
-
0
votes1
answer195
viewsRow 36: Uncaught Typeerror: Cannot read Property 'addeventlistener' of null
Whoa, what’s up, man? I’m doing a various firebase test project. Because he’s making the following mistake: Uncaught TypeError: Cannot read property 'addEventListener' of null This error is being…
-
0
votes1
answer118
viewsExtract data from an HTML form with PHP and write Json
Hey there, guys. I’m trying to get PHP information from an HTML table on a website, but I’m not able to separate the extracted data. My intention is to generate a Json file with this information…
-
0
votes1
answer47
viewsHow to check if a text box has been filled via querySelector in one condition?
I’m using DOM to upload the data and would like to use the if to give a innerHTML different if the fields were filled or not filled. But I don’t know what value to compare... No console.log presents…
-
0
votes1
answer101
views"Error: cannot set Property appendchild() of null
In my code I made a function to create a button and right after the user click on it the button and the other altered content are deleted. I managed to reach that point, but button is at the end of…
-
0
votes1
answer56
viewsHow to dynamically update DOM <datalist> with Angular?
I am learning Angular and with difficulty to update the DOM of an Angular form. My goal is to make an email autocomplete, after putting the "@" in an input: the text is captured and shown along with…
-
0
votes1
answer35
viewsDo you have a problem having nested fans? | Events with Javascript
Hey guys, I made a simple to-do app with pure HTML, CSS and JS. However after q finished the project came to me a question: I have an Eventlistener to create a:…
-
0
votes1
answer66
viewsChange DIV color when clicked on condition (JS)
I am starting in js and I was doing some studies and practicing, but I stopped here, I would like to change the color of these three Divs when we click individually on each one to yellow, but when…
-
0
votes1
answer39
viewsChange background color and turn on all window lights at night (Javascript only)
I am studying Javascript and decided to create a practical project, which consists of a building that I can turn on and off the lights by clicking on the windows, until then ok. But I wanted to…
-
0
votes0
answers36
viewsHow to detect changes in an iframe’s innerHTML and run a function with Mutationobserver?
I’m creating an extension for Chrome and I need it to detect (within an iframe) when an object’s innerHTML is changed and performs an action, example: button.click();. How can I create this…
javascript dom iframe google-chrome-extension observer-patternasked 3 years, 8 months ago Roger Windberg 71 -
0
votes0
answers25
viewsAngular duplicating inputs with ngFor
In this app I want it to only return the value of the quantity in the input if the profile name is equal to the profile name of the data flock , but the angle is doing the following: It runs the…
-
0
votes1
answer24
viewsFor each field that is created add a value
Hello I am trying to create inputs and in them I would like to put the values that have in my array. <div id="guias"> <div class="form-row"> <div class="col-md-6 mb-3" id="origem">…
-
-1
votes1
answer69
viewsDetect id of an DOM element?
I am developing an application in Vuejs/Quasar and need to discover the id of a certain element using the getElementById, how do I do it in Vuejs??
-
-1
votes1
answer88
viewsSimple_html_dom what is the difference between the two Urls?
Url2 works and can extract the data, Url1 does not. <?php include "simple_html_dom.php"; $CARDGALGO = file_get_html("$URLX"); echo $CARDGALGO; ?>
-
-1
votes1
answer60
viewsProblems in incrementing a score / counter
Hello, good evening ! I am trying to create a score for a game, where it contains two different types of scores 2 and 5 points. My biggest problem is that I can’t constantly update the score value…
-
-1
votes1
answer44
viewsfind the character quantity of an imput
1) Create a field and apply the following controls based on the events below: • In focus event change the input background to yellow. •When the field loses focus, recover its respective value and: o…
-
-1
votes2
answers34
viewsResults of an inconsistent average calculation
In one exercise I asked to calculate the average of the notes,however at the time of showing appears a value completely out of logic Script function cadastrarUsuario() { let nome =…
-
-1
votes1
answer74
viewsSelect elements ignoring specific items SIMPLE HTML DOM
I am parsing a table. But within this table there is another table and it is difficult to find the whole elements. I’ll paste the code to illustrate it better. <table> <tr> <td>…
-
-1
votes1
answer60
viewsChange font with Javascript
I need to change the source of a system, I don’t have access to HTML, only via Google Tagmanager, so I need to change the DOM with JS. I didn’t succeed, what’s the best way to do it? var a =…