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
answer61
viewsHow to call and print <td> elements of a <table> script?
I’m learning JS and I set out to do an exercise. The idea is to show a specific month’s calendar on the page, and, according to the current day, pick up and print the td with Index for the day and…
-
1
votes1
answer45
viewsCreate style for various dynamically generated elements
I have the following function, which creates blocks dynamically: function criar(){ let box = document.querySelector('.box'); box.style.display = 'flex' let element = document.createElement('div')…
-
1
votes2
answers358
viewshow to get class name with javascript
I’m making an accordion and it’s already functional as I’d like (just a few details I’ll get right later). Only now I need that when clicked and the panel expanded, the + (show more) sign be changed…
-
1
votes1
answer353
viewshow to change input number value
I am facing some difficulties to change the value of an input (as stated in the question). Follow the code below: function alteraQtdProduto(op) { if (op == 'up') { var num =…
-
1
votes1
answer30
viewsFunction does not fire
I’m starting to work / learn the DOM, but I’m having difficulties, because: const celsius = document.getElementsByName('celsius')[0] const fahrenheit = document.getElementsByName('fahrenheit')[0]…
-
1
votes0
answers95
viewsRead XML with Ajax, Javascript, DOM
As it is possible to read this XML using Ajax, I tried several ways, but so far unfortunately I could not succeed, the goal is to take the number of inum (810265006252830) that will be using in…
-
1
votes1
answer38
viewsappend function only adds last item of my array
I have the following code. For some reason at the time of giving the append to show my li With my data it only shows the last item of my array. Please someone help me window.onload = initPage; async…
-
0
votes1
answer333
viewsHow to style the general scroll bar of the site?
I was looking at some templates online and I was curious about this one. His scroll bar is not part of the browser so I see it but the DOM. How is that?…
-
0
votes2
answers2098
viewsBrowse the entire DOM with jQuery
How to go through the whole DOM and find a certain element in jQuery? Yes, by clicking on li of classe="home", open the div of classe="submenu". <body class="home"> <!-- Header -->…
-
0
votes0
answers70
viewsStudy material javascript
Good afternoon! People, I’m a Javascript beginner and am looking for material or some reference site mainly about DOM. Grateful
-
0
votes1
answer496
viewsCheck if an input was loaded with jQuery
I need to check if a text input has been loaded on the page and check if it is filled in, how can I do that? I’ve tried $('input'). on('load') but it doesn’t work, and the way the script is done I…
-
0
votes1
answer86
viewsAngularjs - Filter ng-repeat checkbox
Keeping in mind that I have an ng-repeat, how do I pick up only the items I marked in the checkbox?
-
0
votes1
answer119
viewsDynamic change in an element when resizing the window
$(document).ready(function(){ var heightJanela = $(window).height() + "px"; $("#banner-hold").css("height",heightJanela); }); I performed the above code, so that when the document is loaded, the div…
-
0
votes3
answers327
viewsExternal HTML in div without server
I own a page Index.html is a series of other html pages. I need to make sure that by clicking on a link the specific document appears in a div. In detail, I can’t use PHP include because I can’t…
-
0
votes0
answers373
viewsAngularjs validation does not work very well
I have a form where it is shown inside a modal, used by the Bootstrap framework, and because of that, the angular validation does not work right. Only some fields are validated and still yes…
-
0
votes1
answer620
viewsHTML manipulation with PHP/JS
How to get content from a page with Javascript? With the content obtained through Javascript (or PHP), how to manipulate it in both languages, in order to read the values, as we do in Javascript…
-
0
votes1
answer140
viewsRegular expression when there are equal strings
I need to take the value "R$ 0,00" in this string with a regular expression. I really don’t understand expressions, I only know the basics of the basic. There are several other values on the page…
-
0
votes1
answer542
viewsCheck dynamically created checkbox
Good afternoon. I need to check if a dynamically created checkbox (is inside a modal) is marked. As it was created dynamically, I thought of the following code: $(document).ready(function () {…
-
0
votes1
answer168
viewsProblem with Domdocument Openssl
I’m trying to get information from a website using DOMDocument but you’re making a mistake. DOMDocument::loadHTMLFile(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL…
-
0
votes0
answers45
viewsproblem in ajaxSucess
Hello, I’m having a hard time executing a script after an ajax call. What I’ve done so far? Well, I will explain: I have a button with 2 actions, however, I need one action to occur before the…
-
0
votes3
answers734
viewsShow image after loading via ajax
Hello, I’m setting up a site with no refresh. When the user clicks on the tab clients are loaded slides of the same, however as the embedded images have a 2mb and end up loading by part. I wonder if…
-
0
votes0
answers31
viewsClone node deeply not working properly
I’m trying to duplicate the div meta from a Youtube video page. It’s the div below the video title div and like and dislike. I want you to have 2 equal ones, one on top of the other. But when I use:…
-
0
votes1
answer2517
viewsWhat is the difference between Document.querySelector and getelementsbytagname?
I would like to know the differences in the use of these two commands, because for min that I am at the beginning of the study very similar and even equal in some moments, but having different…
-
0
votes0
answers119
viewsKnockoutjs shoot event after every modification in UI or model
Hello, as you would intercept changes in the UI or model that were made sensitizing the knockout? Using the subscribeI know there was a change in a property, but what if I had 100 models, with 10…
-
0
votes1
answer441
viewsModify a href URL using PHP HTML DOM
I want to modify a URL of an object that I’m extracting from another site, in this case, from Exame.com. Follows the code: $exame = file_get_html("http://exame.abril.com.br/"); $exame_posts =…
-
0
votes1
answer87
viewsAdding rows and columns in DOM table
I’m having difficulty using DOM to generate an HTML table. Follow my code. function table(){ let max=100; let table = document.getElementById('tableNumber'); table.innerHTML += '<tr>'; for…
-
0
votes2
answers579
viewsremoving li using jquery
Hi I’m making a responsive site and I came across a problem, the desktop layout between the menus has the logo, but for mobile does not have the logo. As the menus are in a li, I wanted to remove…
-
0
votes1
answer164
viewsWhat does this code mean/do?
Well, I’m learning to use Javascript, mainly working with index, and I always come across this, but I want to understand what each part means, because I don’t want to use it without really…
-
0
votes2
answers168
viewsDelete/Destroy html table via javascript
When I needed to completely delete a table or any other html element I used jquery $.empty() in the parent element where the element was. Is there any native way in javascript that does this removal…
-
0
votes1
answer400
viewsAdding items to a list and adding click event next - Javascript
I’m studying javascript and developing a Todo List. The only thing I want to do is add elements to a <ul> and then enable them to click to just change their class. Man html which is very…
-
0
votes0
answers28
viewsresizable and draggable do not work on items added later
I’m using draggable and resizable of jQuery UI to box the user can change the dimension and move. It is working properly if I put the <div> right in the code: <form action="" method="post"…
-
0
votes0
answers50
viewsSelecting elements of the DOM
I am trying to select a DOM element via js to perform an action by clicking. However, the program does not respond to the click. How should I proceed? follows the code! const modalOverlay =…
-
0
votes1
answer272
viewshow to make React render a table
I’m trying to make a table , 5 tall by 7 wide , inside the React , however, when I tried to run the 2° for loop he does not recognize and ends up not doing the action , obg by help S2 function…
-
0
votes1
answer114
viewsHow to include selector next and Prev on XML elements
I’m having trouble eliciting XML elements on flow control Prev/next, what I have is: Code function mostrar(i) { var txt, parser, xmlDoc; txt = "<carta>" + "<para>Marcos</para>" +…
-
0
votes1
answer26
views -
0
votes1
answer31
viewsJavascript ,compare the background of a div by DOM
Good morning gentlemen and ladies,I’m making a comparison to change the color of a div if she has a background Yellow for green but I don’t understand why it’s not working function exerciseTwo() {…
-
0
votes1
answer83
viewsHow and why does getElementById not perform on page loading?
Business problem: I’ll create a system that will run on a server-less platform. It can be a local administration area interface (a client for a service), or a mobile app. The application will load…
-
0
votes0
answers181
viewsHow to get the value of a tag with a specific class/attribute with DOM and php?
Hello. It is that I wish to get the value of a certain tag with a specific class/ attribute using DOM and php. Below is the html that will be used: <div class="header nopadding filmesonline">…
-
0
votes1
answer882
viewsDecrease page size for printing
I made a function that printed a div for me, but I need it printed in tonner size. This is the code: $('#imprimirComprov').click(function () { var conteudo =…
-
0
votes0
answers173
viewsHow to enter email and password inside Iframe input?
I want to know how to insert a value inside the text field inside an Iframe. For example, at this link, there is a simple login. In it, my boss asked me to do the iframe and leave everything typed…
-
0
votes2
answers451
viewsGrab Div’s internal element on the side
I’m trying to make sure that by clicking a button, the contents of div next door is editable. Better visualizing the code: <div id="nome" class="container"> <div class="col-10"> <p…
-
0
votes1
answer3390
viewsHow to pick a td value from the column name
It would take the value of td of a table by the column name. //index definido por numero $valor=$('.table td').eq(0).text(); alert("resultado com index numérico = "+$valor); //index definido pelo…
-
0
votes1
answer749
viewsquerySelector takes class? (JAVASCRIPT)
I made a function to change a photo when an element is added in my table, table that I created a class to be able to change the photo, but to get the html element, I need to use querySelector, but…
-
0
votes1
answer31
viewsIs it possible to use addEventListner this way?
I’m studying javascript and decided to play a little with the creation of fields with the CORE GIFT. This is the code I’ve made so far : <!DOCTYPE html> <html lang="en"> <head>…
-
0
votes1
answer140
viewsWordpress - Contact form 7 does not work with jquery DOM
I have this code that brings documents via DOM to the page $(document).ready(function(){ $('.abas').on('click', function(){ var paginas = ["pagina1.html","pagina2.html","pagina3.html"]; aba_index =…
-
0
votes1
answer79
viewsPrevent Dropdown Menu from closing with Right Click inside it
I would like this Dropdown menu not to close when right-clicking inside it to open a link in a new tab. /* When the user clicks on the button, toggle between hiding and showing the dropdown content…
-
0
votes1
answer30
viewsCheck if Node created with insertAdjacentHTML in a loop is "visible"
I’m looking for fragments of HTML with fetch() and adding to the DOM with the function insertAdjacentHTML() in a loop for()... the function that performs this task is in a Promise() and its return…
-
0
votes3
answers399
viewsCapture Form - More Correct Way
Formerly I called a specific form per creation ID in the body of the document: document.forms[0] Only then did I understand what the attribute is for NAME in these cases, but I was in doubt, for…
-
0
votes1
answer252
views -
0
votes0
answers48
viewsAdd items in the list and click the remove items button and add other items instead
I have tried it in several ways and so far without an exact success, for now what I want in the application is that I type the number in the input, and when I click enter, the numbers are aligned in…