Personally, I just know the Math.random method and I already know how to generate values starting from 0 to another number by multiplication, eg Math.random () * 20.
But I'm trying to do the same thing, starting from 5 to 20, I've already swe...
if(inputUser.value == '' || inputPass.value == ''){
setInterval(changeColor("blue"), 3000);
alert('Tudo em branco');
}
function changeColor(cor){
var prm = "1px solid "+cor;
inputUser.style.border = prm;
}
When I enter a parame...
I have a problem that is simple but I do not use JS at a time so I had a problem.
I'm having to create a menu similar to amazon , but the site is responsive and I've done lists. But it did not look good so I'm doing it with DIVs (if a...
I'm creating a service for an AngularJS application where I should query a ws and return a value for a variable. My problem is that when I use $http I can not get this value to return, if I use a console.log() ... I do this:
ap...
I'm developing a system and want to do validations through functions.
I have the checkUsername function that does query in the database to return me whether or not it can register with that username.
And then you have other function...
I'm trying to fill a dropdown menu which, when the torina is put on a button this works.
But since I want this padding to happen automatically as soon as the document is loaded, I jQuery.ready () for this, however, the function it invokes doe...
There are two problems:
1 - When loading an input select I tried to use a trigger to force the change, but it did not work.
2 - I have 2 selects. When I actually change the value of the first one, the change event is called and "hides" val...
I have the following code, to look up a certain numbering and check if it exists. In the STR variable, text with numbers is sent.
function verifica(str) {
if (str.match = '/\d\d\d\d\d\.\d\d\d\d\d') {
var old = str.match(/\d\d\d\d\d\.\d\d\...
I have a certain array:
acoes_selecionadas: ['nome1', 'nome2'];
I'm using this function, but splice works based on element ID, I need to find a way to remove it by value.
seta_vender: function() {
this.vender = !this.vender;...
I have an array in js with only an id and a description, for example:
var variavel = [{id: 1, descrição: 'Brasil'},
{id: 2, descrição: 'Brasil'},
{id: 3, descrição: 'Chile'},
{id: 4, descrição: 'Chile'},...