Questions tagged as 'javascript'

3
answers

Doubt with LocalStorage -

I have this code that is counting the amount of Clicks, but I wanted it when I close the Browser the counter does not clear. var p = document.createElement("p"); document.body.appendChild(p); $(document).ready(function(){...
asked by 08.11.2018 / 19:24
3
answers

Convert Date to date field

I have a field that receives a date value as in the example: 24/10/18 . I need to replicate this field to one of date type but following the value rule that date requires. Example: 2018-09-24 . That is, convert date 24/10/18...
asked by 24.09.2018 / 17:38
3
answers

Execute Javascript in URL (plugins ..)

How do I run JavaScript snippets in the address bar, I tried in Firefox something like: javascript: alert("lol") , but it seems to be an old technique that does not work (at least not in Firefox). The idea is to have a bookmark in the b...
asked by 17.11.2015 / 15:54
2
answers

Javascript Validation Javascript

Good morning. I need to validate the CEP typed in an input. If the CEP is equal to 35000-000, you must clear the input and send CEP message Not Available. Is there any way to do this using the HTML pattern attribute? How to do? void validaCEP(...
asked by 26.12.2018 / 11:48
1
answer

Problem sending JSON via ajax to PHP

I've been trying to solve this problem for 2 days, I saw some questions from the site, but none solves the problem. I'm putting Ajax in my CBT login, but it will not, it does not make a mistake. I already made a file_exists in the path of...
asked by 12.09.2018 / 03:35
2
answers

Allow to open only one div

Code to call the divs: <input style="float: right;" class="botao1" onclick="addRisco()" value="Adicionar Risco"/> </td> </tr> </table> </fieldset> <div id="riscos"> </div> <fieldset...
asked by 10.08.2018 / 16:10
2
answers

For inside For (Explanation)

I went back to studying logic, since I was only studying front-end and it struck me a very rough doubt about one from another. for (var i = 1; i <=10 ; i++) { for (var i2 = 1; i2 <=10; i2++){ document.write(i); }...
asked by 19.02.2018 / 02:10
3
answers

Require the User to enter a minimum number of characters

I have in my form the date field that forces the user to just numbers and if other options are not selected it returns an alert. But my doubt is referring to the date field already quoted. How do I force the user to enter the 8 numbers of the da...
asked by 01.02.2018 / 14:07
3
answers

arrays equality in Java Script [duplicate]

Good afternoon, I have this little program: let oi=[1,2,3,4] let xau=[] xau=oi xau[2]=7 console.log(oi) My problem is that when in the console the output is: [1,2,7,4] According to what I understand, xau should be a new instance th...
asked by 06.03.2018 / 19:50
3
answers

Add array number and list it

What is the simplest way to do with array a kind of bank where I put a value in an array and show the same later. My problem is to modify the array , where the initial value would be 0 and hence as it is deposited the value will increase ba...
asked by 01.02.2018 / 18:44