Most anwered "jquery" questions
jQuery is a Javascript library focused primarily on DOM handling, event management and Ajax, seeking to free developers from directly dealing with a number of browser compatibility issues.
Learn more…11,371 questions
Sort by count of
-
42
votes14
answers126839
viewsPhone Mask Using jQuery Mask Plugin
I need to change the "-" position on the mask. <label for="telefone" >Telefone</label> <input style="width:25%; margin-right:25% " type="tel" name="telefone" id="telefone"…
-
123
votes9
answers13997
viewsHow to create a website without reloading every click on a link?
I’m looking to develop a site that runs all in the same file, but I’m not sure how to look for study material for this. Thus: Normal site->I’m on the Index.php page. When I click on the…
-
9
votes9
answers2096
viewsHow to assign a function with parameters to click without executing it?
Explanation: I have an application that has by default an event mostraGrupos() and when it is executed, at the end it detaches itself from the element and tries to assign the function…
-
37
votes9
answers34793
viewsInput type="password" with password display eye
I need to put a <input type="password"> with that eye of the reveal password, but it has to work as follows: User clicks on the eye and when dropping hides the characters again. Follow an…
-
9
votes9
answers12142
viewsSearch via ajax during input text ( autocomplete )
I did a search using ajax that when clicking a button triggers a request with the term searched and returns with data that fills a combobox html (select). So far so good. However, I found it…
-
39
votes8
answers48548
viewsHow to pass parameters in function calls by reference in Javascript?
I recently asked the question Why should we use Anonymous functions with jQuery instead of the function directly? and along with the accepted answer came a second question: How to pass arguments to…
-
3
votes8
answers4914
viewsDo not allow saving image of a web page
I don’t want the "save image as.." option to appear when I right-click an image on an HTML page. That is, it will be impossible to save images from the site. How can I do this check?
-
29
votes8
answers95476
viewsHow to check with jQuery if there is a checkbox checked?
I would like to know which Checkbox is checked with Jquery. To catch all the checks I made the following code var checado=false; $(obj).find("input[name='analisar']").each(function(){…
-
17
votes8
answers45427
viewsHow to disable the scroll of a web page?
I’ve been trying to disable one-page scrolling. All I have found are type solutions: #container{ overflow: hidden; } But that’s just occult scroll bar. How I would disable scrolling, even with it…
-
4
votes8
answers12405
viewsHow to switch between true and false checked input?
I have this code and would like to switch between true and false the attribute checked input. Strangely is catching the id of label because the web designer superimposed the label at the input.…
-
6
votes7
answers19609
viewsHow to catch an element inside an iframe?
Why doesn’t it work .contents()? How to catch an element inside an iframe as in the jQuery API example <!doctype html> <html lang="en"> <head> <meta charset="utf-8">…
-
9
votes7
answers31206
viewsHow to insert data into DB with jQuery/Javascript without using PHP?
I am learning Javascript and jQuery and I am wanting to make a small site to test the insertion of data in a database. I have no knowledge in PHP, I wonder if it is possible to insert data in a…
-
18
votes7
answers44529
viewsHow to get only the numbers of a string in Javascript?
I wonder if there are functions that return only the numeric values of a string, if there is not, what is the simplest and efficient way to implement? Example: apenasNumeros("5tr1ng"); Upshot: 51…
-
9
votes7
answers16282
viewsUnderstanding the JSON file
I have a code similar to this on Jsfiddle. On my home WAMP server I did to try working with JSON (Jsfiddle does not contain the JSON file to test). In a question I asked about how to insert data…
-
11
votes7
answers3042
viewsHide input value
I need to hide/remove the value from my input, but I’m not getting it at all, where am I missing? Thank you very much HTML: <div class="caixa-pesquisa"> <div…
-
7
votes7
answers6999
viewsSplit() integer with Javascript
Valor = 19.90; MyArray = valor.split("."); the code hangs , whole variable, however if, Valor = "19.90"; MyArray = valor.split("."); alert(MyArray[0]) = 19; alert(MyArray[1]) = 90; I would like to…
-
11
votes7
answers57425
viewsCheck/Deselect Checkbox from a button
I would like to use a button to mark/uncheck checkbox. I have this button that calls a function, look: <button class='btn btn-large' type='button' title='Todos' id='todos'…
-
58
votes7
answers115219
viewsMask for CPF and CNPJ in the same field
Hello, I looked for this doubt in the questions, but I could not find it. Well, I would like to make a field have the Cpf and cnpj masks depending on the number of characters typed. Here it doesn’t…
-
5
votes7
answers5040
viewsRegular expression for accepting numbers and letters, regardless of sequence
I have the following problem, I need to validate a password field with at least 8 characters, being at least 2 numbers and the rest letters, they can be in any position. 12abcdef abcdef12 The…
-
6
votes6
answers2089
viewsHow to change the bottom lines of a table alternately? With support for older browsers
My table is created with a PHP loop. I do this by PHP even adding a condition or has some better shape? if ($nomSenha == 'xxxxxxxx') { echo '<table class="pesquisaClientes">'; echo…
-
6
votes6
answers5183
viewsHow to reverse the position of a div(and its content and attributes) with another div?
I wish to do this with jQuery, which is the most elegant way to do it? Assuming the following scenario, how would it look if I wanted to switch from position to div2 to div3? (I will not post my…
-
21
votes6
answers18042
viewsHow to make a Custom Scrollbar?
How to modify a scrollbar div, to appear as in the image example below (Hangouts), instead of the standard operating system scrollbar?…
-
12
votes6
answers8117
viewsHow to remove a "href" from a <a> tag with Jquery/Javascript?
I have a tag <a> with hyperlink properly set. However, I would like to remove it when firing from an event. The same tag has a properly set ID, too (unique, valid, and related). I wonder if…
-
101
votes6
answers42802
viewsWhat is the difference between . on("click", Function() {}) and . click(Function() {})?
I usually use it because I learned it was the more correct, the assignment of events as follows: $('seletor').on('click', function(){}); However, I see many developers using the following syntax:…
jqueryasked 11 years, 2 months ago Felipe Avelar 9,507 -
9
votes6
answers2374
viewsHow to select all "empty" elements
Is there any way to select all the empty elements of a page? For some reason that I cannot explain, the code below does not select the input without text on my page: $("input[value=''],…
-
8
votes6
answers5717
viewsDisable Chrome Password Save in Javascript
Would you have any way to disable the option to save password in Google Chrome, by Javascript or jQuery? I mean the login password. When my client logs in appears to him the option to save password,…
-
10
votes6
answers4316
viewsKnow number of checkbox selected
How many checkboxes is being selected and count. Selected 1, mark 1, selected another mark +1, took 1 mark -1. I would like to count.
-
6
votes6
answers2305
viewsTransform results combination function into a dynamic function
I have a function that generates all possible combinations of numbers from 1 to 10. The combinations are 4 numbers, that is, each combination has 4 different numbers. Ex: [1,2,3,4], [1,2,3,5],…
-
6
votes6
answers10935
viewsHow to receive a JSON object from an external url/domain?
I found a Lottery API that brings me the data of the result of a Lotofácil draw, but I am not able to access the data of the JSON object. I’m trying this way: $(document).ready(function(){ $.get(…
-
20
votes6
answers14943
viewsJS Mask for Hours Validation
I’m using in a project the jQuery Masked Input. I made a mask like this: <script> $(document).ready(function () { $("#QuantidadeHoras").mask("99:99"); }); </script> The <input>…
javascript jquery jquery-masked-input jquery-mask-pluginasked 9 years, 10 months ago Leonel Sanches da Silva 88,623 -
4
votes6
answers650
viewsHow to extract a variable from within a function
Suppose I use the following function in .js... And inside it there are some variables. $(document).on("load", function(){ var Variavel1= "um"; var Variavel2= "dois"; var Variavel3= "tres"; var…
-
0
votes6
answers1754
viewsHide dives after selecting another category
Select code <select name="category" class="form-control" id="category"> <option value="">Escolha uma categoria</option> <optgroup label="Vehicle"> <option…
-
7
votes6
answers17707
viewsHow to validate date with Angularjs or jQuery?
I have a simple input that gets a date, how to validate that date if it is true? For example: 31/02/2006 this does not exist 20/20/9999 this does not exist <input name="data" ui-mask="99/99/9999"…
-
1
votes6
answers886
viewsRegular expression to grab the background-image url
I’m not very good yet of regular expression. How could I do to capture only the contents present within the snippet url() of background-image? Example: $elemento.css('background-image'); //…
-
9
votes6
answers2106
viewsSmooth gradient color transition automatically
Hello, I own a div with the following css: background: linear-gradient(to right, #3e42e4, #e53472); And I would like the colors to change through Javascript. Similar to the top of this site:…
-
2
votes6
answers710
viewsOn Click only works once
I have the following code to show and hide content, but it only works once. When I click again to hide, nothing happens. $(document).ready(function() { $('li[name=music]').off().on('click',…
-
23
votes6
answers15200
viewsWhat is and how does Bootstrap work?
I did some research, but most of the articles I found are based on the assumption that the reader already has some familiarity with frameworks (which is not my case), that I still have only a vague…
-
11
votes6
answers3120
viewsHow can we not allow numbers in a textbox?
Good people, I’m trying to do a validation but I haven’t succeeded yet. I want to do a function that won’t let me enter numbers into a textbox. Follow an example of how I currently do.…
-
13
votes6
answers10207
viewsOpen Multiple Bootstrap Modals
As per bootstrap documentation: Modal Multiple modes are not supported and require additional code. I am trying to open various modals within others, these modals are called external files with…
-
4
votes6
answers906
viewsConvert text from div to number
I’m trying to get the text of this structure: <span id="our_price_display">R$ 71,90</span> And I’d like you to return to me just the 71,90. But in the structure I created, I can’t take…
-
7
votes6
answers2555
viewsHow to change the title element text?
Follows code: $(document).ready(function() { $('#1ano_card_title').text('R$20,00'); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <h2…
-
32
votes5
answers5370
viewsHow to apply ! CSS import via jQuery?
I’m trying to apply style to my element and define its importance in this way: $('div').css('height','50px!important'); But it doesn’t work, which would be the right way?…
-
31
votes5
answers14927
viewsHow to not allow a character to be typed in the textbox, with Javascript/jQuery?
I have a Textbox: <input type="text" name="indice" class="number"> I wanted that when a person typed a comma in this Textbox it would be blocked and not appear in the Textbox. How to do it the…
-
13
votes5
answers704
viewsEvent is not tied to the element
I have an event at jQuery (version 1.5) as follows:: $('#refresh_abertos').click(function(){ // aqui o código irrelevante nesta pergunta }); Turns out my element #refresh_abertos is only loaded…
-
11
votes5
answers12033
viewsHow to change the value of a "date" attribute in Jquery?
I have an attribute data-order on a button and I want it to be incremented as I go adding new ones days to my list by clicking the button, so will have: day-1 day-2 day-3 day-4 ... and so on. Does…
-
45
votes5
answers76380
viewsHow to pin a "horizontal menu" to the top of the window when scrolling the page?
I have a layout with a horizontal navigation bar at the top of the site, it is with margin-top:100px, when scrolling the page the menu should be fixed at the top of the window but with margin-top:0.…
-
7
votes5
answers2130
viewsHow to add a class to a <li> by clicking on it, leaving only it with this class?
For example: I have more than one ul with their li; If I click on a li of the first ul she has to add a class; If I click on a li of the second ul, she adds that same class. Only that does not…
-
11
votes5
answers10769
viewsHow to mark and unmark a row from a table by clicking on it?
When clicking on a row of a table, how to mark it by changing the color of the row background, and if you click again uncheck the background, and if you click on another row uncheck the old checked…
-
6
votes5
answers1876
viewsRetrieve a final value from a json in Javascript
You can recover a result value from a url by jQuery? My problem is this, I need to receive the final result of this url:…
-
7
votes5
answers1446
viewsIs it possible to include elements in the DOM after it is loaded and ready?
I have a table that, depending on the amount of an X value, inserts a set of attributes at the bottom of the page (fields). These elements have events assigned to them. But that’s not the point.…