Questions tagged as 'javascript'

3
answers

What does it mean! - // - in javascript?

I ran into an issue where a tag <script> was displayed and contained these HTML comment characters. Function example <html> <head> <script type="text/javascript"> <!-- function Alert(){ a...
asked by 21.06.2016 / 15:16
2
answers

Select text from textarea when clicking

How can I do that when I click on a given button , the text of a certain textarea or input is selected? I wanted answers with solutions with jQuery and also without jQuery (pure javascript).     
asked by 16.10.2015 / 14:11
2
answers

Undo display of errors in the console

Is there any way to block the display of errors on the console? type Javascript errors or something like this?     
asked by 19.03.2015 / 16:19
3
answers

Sort by alphabetic order with header, json

I have the following tree of names in Json : [{"nome":"Alberto"},{"nome":"Cristiana"},{"nome":"Altura"},{"nome":"Ivino"},{"nome":"Otário"},{"nome":"Umberto"}] How do I organize them in alphabetical order indicating when to start a new...
asked by 03.07.2015 / 03:00
2
answers

How to generate incremental variables with Javascript?

I would like to know how to generate incremental variables, for example: var camada = 0 for (i=0; i=20;i++){ var "camada" + i + 1 = 12 } I know that the code is not correct, but I wrote to illustrate what I would like to do, you have to...
asked by 08.05.2015 / 05:31
2
answers

Compare attribute id with class and give .show in another div

I'm making a map of Brazil as svg, I need it when I click on a particular state it gives a show on a different div that will get information about that state. I need to compile the id of the path with the div class and display .show Follow...
asked by 27.03.2015 / 18:49
3
answers

Calculate difference between two dates to validate date fields [duplicate]

I needed to find a mechanism to limit a search that never exceeded 3 months. I have two dates, I want to validate if they are within the defined parameters. I have this code () I'm using type date and datepicker to run on multiple browse...
asked by 14.09.2015 / 11:01
3
answers

Sorting select in alphabetical order with jQuery

I need to sort select alphabetically. I tried to use this function that I found on the internet function ordenarSelect(){ f$(".slc_Reuniao").html($("option", $(".slc_Reuniao")).sort(function(a,b){ return a.text == b.te...
asked by 25.09.2015 / 13:48
3
answers

Click on a buttom and a prompt will appear

I have a button , and I want you to click a prompt to ask if you really want to leave the page, with 2 options: Confirm or cancel. If you click confirm, it goes to the button link, otherwise the prompt closes and nothing happens...
asked by 24.08.2017 / 13:58
3
answers

How do I get the name of an input

Example: <input type="text" name="peixe"> How do I get the name fish? Note: pure javascript     
asked by 19.12.2017 / 19:00