Questions tagged as 'javascript'

2
answers

Parameters in functions in JavaScript

What do the parameters in the functions serve and what do they need? I do not understand the difference between having a parameter in the function, for example No parameters: var V = prompt("Enrte com o valor da tensão"); var R = prompt(...
asked by 18.03.2018 / 15:37
2
answers

Why do I have to "customElements" property?

Navigating here in SOpt found the following question: How to add customElements support for Opera 12 ? , and would like to know how useful this property is. Note that by doing a simple search here, to date there is only this question...
asked by 24.01.2018 / 22:51
1
answer

Sort Array in JavaScript [duplicate]

I have an Array with decreasing even numbers: var a = [20, 18, 10, 8, 6, 4, 2, 0] When I call a.sort() , it returns the following: [0, 10, 18, 2, 20, 4, 6, 8] This ordering is not correct. How can I sort in asce...
asked by 27.11.2017 / 19:16
2
answers

Simplify value comparison in an input

I have a input on my form with id="nome" : <input id="nome" name="nome" type="text" /> I would like the value of this input to be equal to: "jose", "maria" or "joao". I have the following function to check if th...
asked by 17.11.2017 / 02:35
2
answers

How is jQuery built?

As you know, jQuery is an open-source JavaScript library whose intent is to facilitate the manipulation of DOM elements by abbreviating the code to be used to perform operations and procedures, where often in so-called "pure JavaScript" we would...
asked by 21.11.2017 / 04:37
2
answers

Copying an image from one div to another - Methods in Jscript

I have an image and a% div of%. By clicking on the image it has to be copied to the div conteudo-img , which methods can I use to make this copy and which is the most viable via javaScript . #images{ float:left; } #conteudo-im...
asked by 23.11.2017 / 12:35
3
answers

How to submit a form automatically and without refresh?

On my page there is a form where the user chooses a numeric value. I want whenever the user changes the value, the form is sent, without the need to press the "send" button. The code I tried, but it did not work: var valor = document....
asked by 17.09.2015 / 16:49
3
answers

How do I put a button inside an iframe

I tried it in many ways and I could not. I did so: <iframe id="ifrTeste" > <input type="button" /> ou <button...></button> </iframe> I could not get the button inside the iframe.     
asked by 04.08.2015 / 18:28
1
answer

Problems with: Uncaught ReferenceError: $ is not defined

There is a question in this forum here , but it does not solve my problem. I have the includes, including the include jquery in the first row because in that link I found this:    Because, JS interpreter search for $ before is even loaded...
asked by 23.09.2015 / 13:55
2
answers

Click on subitem of the menu brings id of the level above

I'm making a menu where when I click on it I send a code to a page, this page it redirects to the page that was set with that id . Until this point it is working only that when I click on the submenu, it brings me the code of his father....
asked by 10.07.2015 / 15:22