Questions tagged as 'dom'

1
answer

In which programming language does a crawler / scrapper sweep the DOM faster?

I've developed a script in which I use PHP's DOMDocument class to make a crawler on a third-party site. The script speed does not meet the expected goal, I would like to know in which programming language a script for the same purpose...
asked by 23.11.2017 / 17:55
2
answers

Is there any way to format a whole line when finding word on page

Colors & Neutral If highlight of the others, let's say some simple phrases like: Cores do Arco-Íris Cores sortidas Diversas cores e sabores Sem cor, apenas Neutro Preto-e-Branco, neutro Sabão neutro Well, these lines...
asked by 24.06.2018 / 16:07
1
answer

Duplicate element in DOM with JS

I need to add <li> via JavaScript, but when added, from the second addition, it starts to duplicate, triple, and so on, I need to add only 1 element per click. var btn = document.querySelector("#btn"); var ps = document.query...
asked by 22.06.2018 / 16:41
1
answer

Should 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 an error, so I ask if I should correct it by doing this: <a href="java...
asked by 28.03.2016 / 14:40
1
answer

How do I maintain a Javascript function in the DOM even after a page load from another page?

As far as I know, it is not possible to maintain the state of the DOM even after page load, is there any technique or some way out to keep the function in cookie or storage (local, session) to later give eval ()?     
asked by 27.01.2015 / 12:17
1
answer

How to use querySelectorAll () to search for specific tag derived from an element that has an x class?

Would anyone help me use .querySelectorAll() to find all paragraph elements derived from elements that have a classe x?     
asked by 12.07.2018 / 02:02
3
answers

How to show the current date when the page loads

I want to display the current date on a particular div while loading the page, I've already done a functional sketch of the code, however I'm using the button . Follow the code: function formataData(data = new Date()){ var dia = dat...
asked by 22.07.2018 / 20:43
1
answer

How events work in jquery

I'll show examples of just the click event to make it simpler to explain, but this question is about any jquery event. When I started using jquery I only used the click event as follows: $("button").click(function(){ alert('ok'); })...
asked by 15.05.2018 / 22:22
2
answers

Display content of the "title" attribute next to the option element

I have an image thumbnail set in option of select . I would like the script to automatically insert the caption, for each of these images in select , based on the attribute in> title . The example of what I've...
asked by 19.05.2018 / 23:18
1
answer

Remove class and change aria-hidden value when 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 "resized" window, it is hiding and putting in a dropdown [More ...]. made with pure javascript, the dropdown opens and...
asked by 22.01.2018 / 21:57