Questions tagged as 'javascript'

2
answers

Repeated withdrawal

I have the following code: var e = Array (10,20,30,40, 50); for (i = 0; i <= 50; i++) { for (j = 0; j < e.length; j++) { if (i == e[j]) document.write ("O numero escolhido é: " + i + "<br />"); else document....
asked by 18.10.2018 / 12:39
3
answers

Creating html elements in looping javascript

I'm pretty new with javascript and when it comes to creating loopings I totally lose myself, the code below is to create the elements with each click and number the id and the text, but I'm having difficulties with that, I I managed to so...
asked by 06.08.2018 / 18:24
2
answers

Problem with jQuery on display

I'm having a problem, I'm testing JSFIDDLE link when the user clicks on the photo - needs to change image, this is already in the test, but the user when clicking the image below, the top is back to what was ... Thank you
asked by 28.09.2018 / 15:56
2
answers

Return whole part in JavaScript

What's the difference between these methods in JavaScript? console.log(parseInt(3.3)); console.log(parseInt(3.7)); console.log(Math.floor(3.3)); console.log(Math.floor(3.7)); console.log(Math.trunc(3.3)); console.log(Math.trunc(3....
asked by 25.04.2018 / 20:11
3
answers

Get date attribute of last element from a list

Good morning, I am putting together a system that when I click a button I add a <li> to the last row record, however every <li> has numeric data-id for differentiation, that is, I would need to know the last data-id...
asked by 10.04.2018 / 14:06
2
answers

Open popup when specific link

I have to open a popup on a specific page. My JS looks like this: if($('.popup-banner').length > 0) { $('.popup-banner .fechar, .popup-banner .link-fechar, .popup-overlay').click(function() { $('.popup-overlay, .popup-banner'...
asked by 13.03.2018 / 14:19
2
answers

How to save JavaScript objects in JSON format in localStorage, and then deserialize them?

I'm getting values from a form in html, then I want to use a function to get these values and create an object, making them attributes of this object. Then I want to save this object in the browser's localStorage, in Json format, so I can get...
asked by 22.04.2018 / 21:15
2
answers

Convert string to Date (dd-mm-yyyy)

Hello, I need some help. I have a string="01/04/2012" and need to convert to date (dd-mm-yyyy) in pure javascript. Here's what I did: var vencimento = localStorage.getItem('dados2'); //Busca a variável que contém a string = 01/04/2012 va...
asked by 13.03.2018 / 17:34
1
answer

How to debug a code in JSFiddle?

Is there any way to debug / debug a code in JSFiddle ? Usually in the chrome development tools there are several scripts, what is the correct way to put the breakpoint's to debug the code? Is there any way to debug via code?     
asked by 07.08.2017 / 16:23
3
answers

Javascript function when clicking on any class="xpto"

I have a calendar where every day is: <a class="dia" href="#">(Número do dia, ex: 1, 2, 3, etc)</a> I did this below, but the problem is that I can only choose 1 class, I want it to work with either: <a class="dia"...
asked by 12.07.2017 / 19:49