Questions tagged as 'javascript'

5
answers

How do I search for a particular object within an array?

I need to know if given Array has objeto with a certain value in its index. I tried to use indexOf , but I was not successful. arr = []; arr.push({id: 1, nome: 'Wallace'}); arr.indexOf({id: 1}); // -1 How can I do t...
asked by 31.07.2015 / 16:05
3
answers

How to make the first two numbers of a Math.random sequence are not EQUAL

I made a lottery system in order to learn, I will not post the whole code here just the part that I am packed. It is as follows: The draw of the PC is a sequence of 6 numbers that I present in the DOM (it does not matter), so I want the first...
asked by 05.10.2014 / 07:02
2
answers

What's the difference between For, ForEach and Find in JavaScript?

What's the difference between the 3? For , ForEach , and Find     
asked by 24.01.2018 / 17:24
5
answers

Disable Save Password in Chrome in JavaScript

Would there be any way to disable the password saving option in Google Chrome, by JavaScript or jQuery? I mean the login password. When my client logs in he appears the option to save the password, and after he has enabled it, he always logs...
asked by 27.03.2014 / 16:13
5
answers

How to center a div with position: fixed?

I wonder if it's possible to center a div with position:fixed ? Currently I tried to centralize it using margin:0 auto but it did not work ... unfortunately as the width of my div fixed will be dynamic I can not use left and...
asked by 22.09.2014 / 23:15
2
answers

Infinite loop when walking recursively through DOM nodes

I have div with contenteditable=true in my document and want to highlight certain parts of the text as the user types (add spans). For this I first need to extract the text typed by the user in the form of a simple string, without...
asked by 10.01.2014 / 14:38
2
answers

How do I do an action after three dynamic elements are populated with jQuery / javascript?

I have three select that are created after the user clicks a button, ie they are dynamic: <select id="cbExercicio"><option value="0"></option></select> <select id="cbEquipe"><option value="0"></option>...
asked by 27.01.2014 / 16:08
2
answers

How to effect cascade with Javascript / jQuery?

Imagine that I have a list of 20 <li> blocks, and that when the page loads, each of them should be shown with a millisecond difference from one to another (this would be done with CSS3 , so code just have to add a class in the...
asked by 06.04.2014 / 00:38
3
answers

Change class with javascript when resizing screen

I need a javascript code that changes the menu class to the responsivemenu class when the screen resolution is less than 750px .     
asked by 30.11.2015 / 17:54
4
answers

How to sort three divs according to an attribute of it?

I have 3 divs: <div id='pai'> <div class='produtos' contagem='2'></div> <div class='produtos' contagem='1'></div> <div class='produtos' contagem='3'></div> </div> I would like to s...
asked by 09.01.2015 / 17:10