Questions tagged as 'javascript'

4
answers

Onclick call two functions at once Javascript [duplicate]

Good morning, it is possible when you click on a button to run two onclick functions at once, eg two different alerts?     
asked by 04.08.2016 / 17:18
5
answers

What does it mean? and: within an expression? [duplicate]

I saw on a website the following code: var campo1 = document.getElementById('valor1').value; var campo2 = document.getElementById('valor2').value; var maior = (parseFloat(campo1) > parseFloat(campo2) ? campo1 : campo2); var menor = (pars...
asked by 25.03.2014 / 21:34
3
answers

How to update the table (bootstrap-table) via JS after registration?

Once you register (within a modal), the table must be updated automatically. But I can not. NOTE: Languages I'm using are PHP and JS. In jsfiddle, there is a small demonstration, in the JS tab is the (else) code that I am trying to do to upda...
asked by 12.02.2016 / 18:07
3
answers

Do the Bootstrap dropdown close when clicking another dropdown in the same menu?

The menu must remain open while I click anywhere on the document or screen, but when I click on the dropdown of a second menu, it should close the previous menu, and also need to open and close by clicking the dropdown. My bootstrap code:...
asked by 14.04.2016 / 14:30
1
answer

How to read the browser logs?

I'm creating a page in html that should display the all browser logs (% with%). So that when there is a script error I can access this page and view the browser logs.     
asked by 01.03.2016 / 19:33
1
answer

How to get the values from a table?

My question is pretty basic: I have a table , I need to store in a variable all values of the line that was clicked, I'm trying this with this method below but the result is "undefined". What could be wrong with the code? Or how coul...
asked by 14.02.2016 / 19:10
4
answers

Manipulating chances with JS when using Math.random ()?

When using this function Math.floor((Math.random() * 10) + 1) I get a random number from 1 to 10. We assume that each number has a 10% chance so we have a 50% Odd or Even chance, but what if I wanted to manipulate those chances, so that t...
asked by 04.04.2017 / 20:26
1
answer

Adding and Removing Fields Generated via CakePHP

I have a <select> that is fed by data from the database. I need to manipulate this select and multiply it if the user wants to enter more different data. I also need to change the "name" attribute of each <select> so...
asked by 12.02.2015 / 15:45
1
answer

I would like to change an attribute of a dynamic element with jquery

I have the following code that I thought would work, but nothing happens ... $(document).on('click', '#tab-departamentos a', function(){ $('textarea').each(function(){ var a = (this.scrollHeight-12)/20; //alert(a); $(this).attr...
asked by 06.02.2015 / 15:52
3
answers

How to add a class in pure JavaScript?

I want to turn this line that is jQuery into pure Javascript: $('#menu #<? echo $idMenuAtivo; ?>').addClass('active'); How could I transform it?     
asked by 01.08.2017 / 22:51