Questions tagged as 'javascript'

3
answers

How to make a "submit" in javascript?

I am making a very simple game in html and javascript, the idea is that the user put the result of each operation, and if it is right, an alert appears for him. I wanted to use a table because I want to exercise this. The program is almost done,...
asked by 21.09.2015 / 21:20
2
answers

How to check the 4 vertical and horizontal elements in an array based on the current position?

Let's suppose I have an array like this: $matrix = [[0, 1, 1, 0], [1, 1, 1, 0], [1, 0, 0, 0]]; Imagine that you are looping and capturing the position of this array as in the example below, y lines with my arrays and...
asked by 21.09.2015 / 21:16
1
answer

know position of a tr (html tr / tr) in sequence of tr

I have a simple screen, where I have already been able to create elements dynamically, with the click of the button, these elements are draggable up and down, and are two different elements, a textarea and a img that are added dyna...
asked by 20.10.2015 / 00:58
3
answers

Multiple callbacks with JavaScript

Hello everyone. I have two distinct function callbacks that give me values that need to be used outside of these functions. Here is the code: FB.api('/me', function(response) { FB.api('/me/picture?type=normal', function(response) {...
asked by 03.08.2015 / 23:57
1
answer

Create a random combination with CSS classes using javascript or jquery

Hello guys, I was wondering if anyone knows any solution how to do a combination of css classes using javascript or jquery? What I would like is to have links and each of these links have several classes of color, and after selecting one of t...
asked by 07.07.2015 / 15:30
2
answers

Javascript - Showing and hiding divs according to selected checkboxes

I have the site with 9 checkboxes, each associated with a div. When a checkbox is selected, the div related to it is shown. When another checkbox is selected, the div related to that other is also shown. For example, chkCamp1 shows optCamp1. chk...
asked by 23.10.2015 / 14:54
2
answers

FizzBuzz test in Javascript

I'm trying to test the "FIZZBUZZ" which consists of the following:    Write a program that prints the numbers from 1 to 100. But for   multiples of three print "Fizz" instead of the number and for the   multiples of five print "Buzz". For num...
asked by 29.10.2015 / 13:21
1
answer

Calculating javascript and playing in html table

I have a html table of 3 columns, the first 2 are <input type="number"> and the third is text. I want to play in the third the sum of the values of inputs using onchange , but what I am facing is that if I put "2" in...
asked by 09.07.2015 / 20:06
1
answer

How to save a JSON locally?

Direct question: What is the best way to save a JSON file locally and how to do it? Details: I have a web application that receives user data using the Facebook API (Javascript SDK), I need to save this data to a JSON file locally. After sa...
asked by 27.10.2015 / 19:46
1
answer

Radiobutton and Checkbox Sum

I am here a code in js that when selecting a checkbox it displays the value of the checkbox in an input and if I select more than one it adds the selected checkboxes and displays the total value also in the same input My problem is this, the tim...
asked by 27.10.2015 / 05:26