Questions tagged as 'javascript'

2
answers

How to create a script to automate link exchange in HTML?

I'm performing maintenance on a system that has hundreds of links on one page as follows: <li> Revista alvo <a href="http://exemplo.com"> http://exemplo.com </a> </li> Note that there is text out of the a tag....
asked by 14.05.2018 / 23:22
2
answers

How to add invalid status in html input fields?

I am doing validations in the database before the user submits the form, however, let's say the typed email already exists in the database, as I could mark the input field as invalid so that the user can not send if the current value of...
asked by 15.05.2018 / 15:38
1
answer

Error trying to use HTML5 Local Storage

I am studying about local storage in HTML5 and JS, understanding that its purpose is to store texts in local / p> When testing, I got JS errors. I would like to understand why: <scripttype="text/javascript"> function exibir(){...
asked by 23.09.2014 / 19:37
2
answers

How to validate password through JavaScript

I have a form that I need to confirm if the fields, NovaSenha and CNovaSenha, are the same. Only if the two fields are the same as the system will allow from the post to the file_exchange.php If it can be with jquery, it's even better. I accept...
asked by 25.08.2014 / 19:38
1
answer

Initial condition (IF) does not work

I'm trying to play a game of old. So far I have been able to make the markings alternating with each shift and the function to delete the markings. ps: I'm using black and red instead of ball and "x". My problem is that the markup changes...
asked by 10.11.2014 / 23:21
1
answer

Dynamic calculation

I have 6 inputs and when I type a percentage value I need to recalculate the value of the following, but if I change some value from another field it needs to recalculate the remaining ones so that the sum of the inputs gives 100%; > <!D...
asked by 11.08.2017 / 14:00
2
answers

How to get a single element through array.filter

Using array.map and array.filter , I select only one object of address , but its return contains array with empty indexes. array has the following structure: [ { "formatted_address": "275-291 Bedford...
asked by 23.08.2017 / 17:05
2
answers

How to make two events not fire at the same time

I need to make a menu that when I click the button it appears and when I click it it disappears. Home The problem I've been facing is that the event to make the menu disappear is the same as it appears, so it goes into a small loop. How do I not...
asked by 05.09.2017 / 21:46
2
answers

Pass entire variable from javascript to php [duplicate]

I would like to know why the following snippet does not work ... <?php $window = '<script>document.write(window.innerWidth)</script>'; //exemplo de saída 'string(50) "1366"' if($window > 920) { echo 'maior'; }else{...
asked by 04.09.2017 / 06:40
1
answer

About array indexes

In javascript, how do I access the index of an array that is contained within another array? For example: var x= [ [ 1,2 ] , [ 1,3 ] , [ 1,4 ] ]; How would you go about accessing the corresponding index of the [1,4] vector that is...
asked by 02.09.2017 / 19:18