Questions tagged as 'javascript'

1
answer

Doubt - Function to clear img with javascript does not work

I need to clear a img field and for this I am using the code below, but clicking on button javascript does not work because the page receives a refresh. I looked at the browser console and there was no error message ... Can you...
asked by 23.08.2017 / 23:42
3
answers

Q: choose two select and display result

So, guys, I'm new to the site and I'm in desperate need of help. I'm creating a site where the person selects home city and destination city So, okay, I want it when the person selects these two options and clicks on the value of the ticket, sho...
asked by 01.03.2017 / 00:57
2
answers

Identify the correct textarea to send by pressing Enter?

I had "solved" a problem sending a textarea by pressing Enter in my application, but it ended up only sending it to the first textarea of the page. The application loops registered posts in the database and for each post there is an area for...
asked by 26.02.2017 / 18:10
3
answers

How to make a regressive timer with html5 + css + javascript, which at the end of the selected time tap (or execute) a * .mp3

I started testing with this HTML: <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body onload="principal();"> <audio id="audio"> &l...
asked by 22.02.2017 / 00:10
1
answer

What is the safest way to test if a data-* attribute exists?

I need to test if a data-* attribute exists on an element and if that attribute is filled with some value: <input type="text" id="teste" data-validationMessage="Esse campo é obrigatório" /> <!-- Deve retornar true --> <input ty...
asked by 21.03.2017 / 20:54
2
answers

How to add attribute in JSON array?

I have the following JSON: [{"descricao": "teste", "January": "2454.00", "February": "220.00", "March": "1070.25"}, { "descricao": "teste2", "January": "275.00"}, { "descricao": "teste3", "January": "275.00"}] I need to record in a va...
asked by 24.03.2017 / 12:40
1
answer

Start with hidden div and show with button

Based on the answer below, I created the button that displays and hides div , but what I would like is that div started already hidden and had a button to display it. How could I do it? How to hide / show an HTML div?     
asked by 21.03.2017 / 23:02
2
answers

Why do browsers render the same page in different ways?

I'd like to know why browsers read the same page (HTML, CSS, and scripts) and the result displayed is different in some cases.     
asked by 24.03.2017 / 20:45
3
answers

Javascript - How to pass parameters to a function of an Event Attribute

I'm not able to run a code, where I create a function separately and call it whenever you want, but only changing the parameters. Javascript does not execute function minhaFuncao(num1, num2) { //codigo } variavel.onclick = minhaFuncao(nu...
asked by 23.03.2018 / 07:25
2
answers

Make calculations between Inputs

I'm using a plugin that when you click the + button it multiplies the value. It works perfectly but the calculation is only done within <span id="price" class="amount"></span> and brings Total within <span id="total...
asked by 17.01.2017 / 13:10