I need each button when clicked to turn yellow and the others return to normal ... follow the code and the fiddle:
$( "#botoes" ).each(function() {
$(this).click(function() {
$(".botaoativo").removeClass('botaoativo');
$(th...
In PHP, when I need to mix an array, I use the shuffle function.
So:
$a = array('@wallacemaxters', '@rray', '@CiganoMorrisonMendez');
shuffle($a);
print_r($a);
output:
Array
(
[0] => @CiganoMorrisonMendez
[1] =>...
I'm trying to make clicking on the "next" link one of my lists revealed and the previous one being hidden, using a class that has display: none; , tried with .next() of jQuery but there were some problems, such as , for example, in...
How to check if the image returned with 404 error via javascript.
Below a sample code, I want to check if the get of this image is 404. If I want to put a certain image, if it does not return the image.
<!doctype html>
<html lang="...
What is the use of the colon : in JavaScript, like the example below:
function paciente(nome, idade, altura) {
var clazz = {
imprime: function() {
alert("nome: " + nome + ", idade: " + idade);
}
return clazz;
}
I kn...
I have a paragraph that contains multiple links, alternating between words or numbers. I need to do the following check: if the link within the paragraph is any text, it will not do anything with the text, but if this link has a number, it will...
In Javascript, when I need to do a reduction operation, I use the Array.reduce method.
So:
var valores = [1, 2, 3, 4, 5, 1000];
var resultado = valores.reduce(function (soma, atual) {
return soma + atual;
})
console.l...
I need to split a string into a specific size in JavaScript.
I know you can use Join to turn a string into a array of letters:
'hello'.split('')
However, I need a way where I can determine the size at which this st...
For example, if I have the following code:
var i, j;
for (i = 1; i <= 3; i++) {
for (j = 1; j <= 3; j++) {
if (j === 3) { break; }
text += "The number is " + j + "<br>";
}
}
When using break, it breaks th...