Questions tagged as 'javascript'

2
answers

How to control file type in Javascript without capturing extension?

Example: <input type="file" name="meu arquivo"> I know there is a way to catch the name of the extension described, but my goal is to prevent the client from changing the file extension, for example, PDF to TXT and try s...
asked by 16.07.2014 / 16:16
2
answers

How to print a javascript variable inside an html tag?

How to print a javascript variable inside an html tag? <script> (function() { var PORCENTAGEM = '25%'; })(); </script> <div class="progress progress-striped active"> <div class="progress-bar" style="widt...
asked by 24.07.2014 / 22:04
3
answers

How to call Javascript functions in another Javascript

I wanted to call a function from a Javascript in another Javascript file. For example, in the calculate.js file, I have the function add (a, b) . And I needed to call this function in the calculator.js file (for example). I was wonder...
asked by 23.07.2014 / 13:54
2
answers

why is 8 appearing and not the number referring to i?

<style> .menu > li:hover .sub-menu{ display:block; } </style> <ul class="menu"> <li>li 1</li> <li>li 2</li> <li>li 3 <ul class="sub-menu"> <li>l...
asked by 08.05.2016 / 19:07
2
answers

How to subtract hours from a date in javascript?

I have a variable that gets the current date and I need to subtract hours from that date. var data = new Date(); How did you hours from that date?     
asked by 25.07.2016 / 20:18
5
answers

Capturing Enter in IE using jQuery

I have the following code in jQuery: $(document).keypress(function(e) { if(e.which === 13) $('.button_ok').click(); }); When I click the enter key, it causes the user to click on the button of class button_ok . It w...
asked by 01.09.2016 / 16:17
2
answers

How to simulate a jQuery keystroke?

I would like to know if there is any way to simulate keystrokes with jQuery. For example, when you click a button, you simulate that the "down" and "left" keys have been pressed, as if the user had them. $(document).on('click', function ()...
asked by 02.05.2016 / 15:43
2
answers

How to create a number generator from an Initial number and a Final number?

I do not know if it is done in php or javascript, I have read tutorials but I could not get anywhere ... I would like to create a system for me to put an initial number and an end and in that interval would have 20,000 numbers and that were gene...
asked by 16.07.2016 / 19:52
2
answers

Palindrome check function

I have the challenge of writing a code to check if a text is a palindrome or not. I have not finished the code at the moment, it's like this: function checkPalindrome(str) { var direita = []; for(var i = 0; i<str.length; i++){...
asked by 15.07.2018 / 20:40
4
answers

Help with exercise

Can anyone help me correct this exercise? I'm trying to finish these lines and I can not: module.exports = function restaurantBill(bill) { /* 1. Crie uma variável chamada tax (imposto em inglês) e atribua-lhe o resultado de multiplique a...
asked by 04.05.2018 / 18:48