Posts by NoFace • 634 points
32 posts
-
0
votes1
answer39
viewsA: Dropdown with check radio, how to know which one is selected?
Well, you can use one function and create an object to have the values that will be passed to the function: function segundos(seg){ alert(`${seg} Segundos`); $("#refreshText").text(`${seg}…
-
1
votes2
answers51
viewsQ: When one Function terminates the other ends also multiprocessing asynchronous functions
I’m using the library multiprocessing, running two def at the same time, but I want to finish one of the two def the other that is still running also end in the middle of the process. Example: from…
-
0
votes1
answer33
viewsA: My innertext does not work together with the variable
You are using querySelector, would have to put a # to catch the id in question. Works as a CSS selector, # for id and . for class. function clicar(){ var a =…
javascriptanswered NoFace 634 -
0
votes1
answer66
viewsA: Add items using Javascript?
var botaoA = document.getElementById('bt-a') var botaoB = document.getElementById('bt-b') var botaoC = document.getElementById('bt-c') var total =…
-
3
votes2
answers75
viewsA: Concatenate two arrays according to their respective indices
Just make a for and join the elements. var array1 = ['a','c','e','g'] var array2 = ['b','d', 'f', 'h'] var array3 = [] for(let i in array1){ array3.push(array1[i]+array2[i]) } console.log(array3)…
-
4
votes2
answers82
viewsA: How to store different values in a single variable
You would need to create a list to do so. And use .append() to add values to the list. cont = [] for c in range(1,8): cont.append(c) print(c)…
-
2
votes1
answer31
viewsA: How to swap a div of place with script?
You can "copy" the div geral-2 with a outerHTML define or return the HTML element and all its contents, including the initial tag, its attributes and the final tag. Then remove the old geral-2 and…
-
1
votes2
answers299
viewsA: How to save an To-Do-List in localstorage in javascript?
I did some research and performed tests and it is not possible to store array in localStorage it automatically converts the array in string, one array that would be an example var arrayFrutas =…
javascriptanswered NoFace 634 -
3
votes3
answers169
viewsA: What is the loading="Lazy" attribute for images and iframes?
the Attribute loading can be used in tags <img> or in tags <iframe>. It specifies for the browser whether to load <img> or <iframe> off the client screen, should be done…
-
0
votes1
answer26
viewsA: How do I create a caption that shows the contents of the column in the database?
echo '<td title="'.$exibir_colunas['nome'].'">'.$exibir_colunas['nome'].'</td>';
-
0
votes1
answer38
viewsA: Send form as variable in external javascript
You will need to store the value of input txt, the way you did it won’t work, because the javascripit is a Front-end language, the text variable and input do not exist in _log.html. But to…
javascriptanswered NoFace 634 -
0
votes2
answers44
viewsA: Accessing HTML elements in the Array
First of all this is not necessary Array.from. Use the children to take the child elements of this tr, that these children are the td. If td has the backgroundColor == 'red' or backgroundColor ==…
javascriptanswered NoFace 634 -
0
votes1
answer45
viewsA: Access variable in another function, javascript
A global variable that has global scope : all scripts and functions on a web page can access it. And even if you are inside or outside the function, where you prefer to put it, you assign a value to…
-
0
votes1
answer58
viewsQ: id PRIMARY KEY, AUTO_INCREMENT starting from 1
I’m having a doubt, a stupid problem. Before to carry out this code: CREATE TABLE tabela ( id int AUTO_INCREMENT, title varchar(50), descricao varchar(100), PRIMARY KEY (id) ); when putting the…
-
0
votes1
answer112
viewsA: Show and hide fields as checkbox is selected
Hello, there are some inconsistencies in your code, and things that are not hitting. I tidied up here is working perfectly, steps: The tag label for="quais_redes" right at the start, it’s being a…
-
2
votes2
answers94
viewsA: How to call a function within the setTimeOut() method by passing parameters?
The two best ways to solve this issue are: first by creating a function in the setTimeout() and that this function flame to function in which you want her to exercise, in this case the msg(txt).…
javascriptanswered NoFace 634 -
1
votes1
answer319
viewsA: Take SELECT value with JS
When you select a option in a select the value of option selected will be the value of the tag select, then you can make a addEventListener change, to detect changes in the select and then take your…
-
7
votes4
answers3540
viewsA: How to count occurrences of a letter in a sentence?
Make another variable to serve as "counter variable". In the case of the example below, I called quantidade, that each frase[i] if it equals letra will add +1, until you reach the final result. Why…
-
1
votes2
answers76
viewsA: Delete table row through an ID
I would recommend a addEventListener of click in the entire document, clicking it will take the class attribute of the element clicked with a target and getAttribute(), if it’s material-icons, he’ll…
-
2
votes1
answer123
viewsA: Change status according to date
Dai you add not to lose input from data_corrida, I believe you’ve done it in $row[0]['dt_corrida1'];, but finally makes a function that when loading it is executed. The model where the input type is…
-
4
votes1
answer188
viewsA: How to capture click event with mouse scroll?
Makes a function with mouseup (when it releases a mouse button), which when releasing any mouse button it captures the button who was released. 0: Main button pressed, usually the left button or the…
-
1
votes1
answer57
viewsA: Change field after filling the zip code - Html/Js
When it reaches the maximum number of characters in the input of the CEP he loses focus with the blur() and the input number wins focus with a focus(). Example: function foco() { var cep =…
-
0
votes1
answer27
viewsA: Fill input by clicking button and multiply values
Creates variables for the elements of inputand the input type button, puts a addEventListener() for when you click the add button it makes a function q adds +1 for variable produto and if you click…
-
0
votes1
answer39
viewsA: I want to be able to customize OUTPUT, I want to be able to customize the result of the calculation but I cannot with this code
Instead of using document.write() create a paragraph element creates a variable for the classification (not required is only to facilitate) puts it as element Child (child) of body, calls a idfor…
-
0
votes1
answer27
viewsA: Mandatory checkbox when pressing button
Adds the attribute required in the html tag of the field you want to be required Example: <form action="#"> <input type="checkbox" name="myName" id="myId" required> Li e Concordo com os…
-
0
votes2
answers36
viewsA: No Clear form after wordpress Submit
To resolve this, make clicking on Ubmit call a function that takes the values of the inputs in question in the form before actually sending and then just assign the values that were taken in the…
-
0
votes1
answer31
viewsA: Button placement to screen resize
Tries to add a seTimeout() in function btnAppear(), to keep calling the function again by positioning the button. Try and see if it works. function btnAppear() { buttons.style.top = `${positionYBtn…
-
0
votes1
answer36
viewsA: How to enable a class in html through Javascript
var btn2 = document.getElementById('myBtn2') var showTag = document.querySelector('.controls') //pegar a div com class 'controls' sóp ara testarmos no final btn2.addEventListener('click',…
javascriptanswered NoFace 634 -
2
votes3
answers124
viewsA: How to use a variable within another function?
You can put the var dados = '' out of function so it becomes a global variable that has global scope : all scripts and functions on a web page can access it. And also whether you’re inside or…
javascriptanswered NoFace 634 -
1
votes1
answer247
viewsA: How to resolve Uncaught Typeerror: Hidden is not a Function at Htmlbuttonelement.onclick?
Change the name of function because there is a conflict between the name of function hidden. For the hidden is a Global Attribute. The same kind of conflict happens when you put something like HTML…
-
1
votes4
answers91
viewsA: How to transform a "for" repeat code into "while" in Javascript?
var ordinais = ['primeira', 'segunda', 'terceira', 'quarta']; var media=0; var i = 0 while (i < ordinais.length ) { var nota = prompt("Informe a " + ordinais[i] + " nota: "); if (nota === "" ||…
-
0
votes1
answer40
viewsA: Select dependent textarea or textbox
From what I understand you want to put a select and that when selecting an item of this select the autocomplete/Autofill of the textbox will put in the datalist certain values. Js and then Html…