Questions tagged as 'javascript'

2
answers

Show and hide a div by clicking on the same link

How do I show a div when I click on a link and hide again when I click on the same link?     
asked by 29.06.2015 / 23:24
1
answer

Error SyntaxError: Unexpected token else

I am creating a "Stone, Paper and Scissors" Game, I am in the final moment, but my code has an error that I can not identify. var userChoice = prompt("Voce escolhe pedra, papel ou tesoura?"); var computerChoice = Math.random(1); if (computerCh...
asked by 26.06.2015 / 02:11
2
answers

How to display the sum of an X value where it has the same name?

Hello, let's say I have an object that has the following values var json = [ {"nome":"Coisa A", qtd:2}, {"nome":"Coisa A", qtd:3}, {"nome":"Coisa B", qtd:5}, {"nome":"Coisa B", qtd:7} ] Well, I can return these value...
asked by 25.07.2016 / 15:03
2
answers

How to hide a div just in firefox

Hello, In what way is it possible to hide a <div> only in Firefox and display in other browsers?     
asked by 01.07.2015 / 22:25
1
answer

Lock scroll scrolling across screens

How do you block the scrolling of the page by the keys with jquery, up key (38) and down key (40), leaving the scrolling only with the mouse?     
asked by 26.07.2016 / 16:16
2
answers

Receiving the error "is not a function" for a declared function

I was writing my js, when I come across the following error: Uncaught TypeError: xyz is not a function Released from code (shown simply): (function () { function abc() { var xyz = xyz(); } function xyz() { co...
asked by 26.07.2016 / 14:41
3
answers

Calculate Present Value in Javascript

I need to calculate the present value equivalent to the Excel formula, I have the following data: VP (2.5%; 48; -2052.50) that excel does not return me the value of 57,000.00 rounding down. Can anyone help with this in javascript? I tri...
asked by 30.06.2016 / 22:30
2
answers

Add days to Javascript Date () in the format dd / mm / yyyy [duplicate]

Hello, How do I show the date generated in the Brazilian format? I searched here and on the internet but could not execute as I need. See: $(document).ready(function () { $("#button").click(function() { var dias...
asked by 19.06.2015 / 16:32
1
answer

Show selected option in select with JS

I have a code snippet where I want to get the value of option selected with JavaScript, and give alert with that value. However, every time it gives the value as undefined . I made a line to put in a input too, just to...
asked by 23.05.2017 / 15:13
2
answers

Sum of values with javascript, error?

I have a solution that does the sum of values with respect to the value of a input check only if it is selected, but if you select the items from first to last, the sum is normally done but only the last input of the table the valu...
asked by 17.05.2017 / 15:33