Questions tagged as 'javascript'

1
answer

Regex to validate national document number

I'm trying to create a national document validator that accepts numbers and letters or just an 11-character JavaScript limit number. The problem is with regex creation. Follow the code: var documento = 'abc123-$/'; alert(documento.replac...
asked by 17.10.2018 / 11:05
2
answers

How do I focus on a 1-minute minute pop-up?

How do I focus on a 1-minute-a-minute popup? Remembering that the popup is minimized and I want to leave it "in evidence" on the user's screen.     
asked by 20.02.2014 / 14:44
3
answers

Change scrollbar placement in a div

By default, in a horizontal menu the content is read from left to right, as in this image: However,Iwouldlikethatwhenthecontentloads,thescrollbaris,say,automaticallymovedtotheright,asinthisimage: Is this possible?     
asked by 17.10.2018 / 19:05
2
answers

how to make a div appearing following the cursor?

Good afternoon, guys. My question is the following, I am creating a payment form, I have the following code: $(".spanhover").hover(function(event) { var divid = "#popup1" $(divid).css({top: event.clientY, left: event.clientX}).sh...
asked by 23.11.2018 / 19:42
2
answers

Return and console.log do not work as expected in Codecademy

I am doing Javascript course on Codecademy , I did the function, it is returned what the exercise asks for, but I do not step.     
asked by 25.06.2015 / 01:06
2
answers

Limit Input to a Range of Values

I am creating a small shop that will sell shirts for an event and the sale of the shirts will be limited to a maximum of 4 shirts per person, so I need that in the field where the number of shirts that the person wants to buy is defined is limit...
asked by 18.04.2015 / 18:05
2
answers

Use style within javascript if

Hello, I was doing a test in javascript to see if the value of two inputs were different, if they were I would change the background of an input to red, and tried opening the style tags inside the if and instead of appearing so appearslikethis...
asked by 09.05.2015 / 02:26
2
answers

addEventListener does not work with parameter passing

I have two inputs that both have an id, and I have a button with an oncick event bound (directly in HTML) that receives the value of both input fields as input, now I want to separate javascript into a separate file, but I can not make the javas...
asked by 10.04.2015 / 16:38
1
answer

Menu css + javascript and jquery

Well, I need to create a way to recognize which menu I'm clicking on, I have my index where I call my menus with an include, so I need to put a green bar in the bottom of the menu that is clicked. How to do this? <ul class="mainnav">...
asked by 12.06.2015 / 18:23
3
answers

How can I make this code more functional in Javascript?

This code solves the problem of finding the num prime between 0 and 10,000: function PrimeMover(num) { var counter = 0; var primes = []; for (var i=2; i<=10000; i++){ for (var j = 2; j<i; j++){ if (i%j===0) { cou...
asked by 23.06.2015 / 23:35