Most voted "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
-
12
votes4
answers4310
viewsEnter key do not give Submit
How to make the enter key fail Submit on a form? Example: in an input by pressing the enter nothing happens. Today I press the enter, the browser gives a Submit, as and had clicked on send button.…
-
12
votes1
answer11265
viewsHow to create a dynamic progress bar considering all fields of a form?
I’m trying to create a progress bar a little different from the ones I found around. This for example, take the values of the fields and plays in the aria-valuenow from the progress bar. In my case,…
-
12
votes2
answers9932
viewsWhat is the difference between . prop() and . attr()?
Do these two jQuery functions do exactly the same thing? Or is there any difference between the same. You are informed that the function .prop() came from jQuery 1.6 She came to replace .attr() ?…
-
12
votes4
answers489
viewsHow does jQuery make parameters dynamic?
I noticed that in jQuery, parameters can often be passed or omitted, and regardless of order, they work as expected. What I mean is this. See the following codes below: $('#x').fadeOut(function(){…
-
12
votes3
answers425
viewsDifference between '$()' and 'jQuery()'
It is common to see, in codes that use jQuery, references to selectors using the $(). Only I’ve already found codes using jQuery() to make darlings selection. What is the difference between them?…
-
12
votes1
answer8949
viewsList states, cities and neighborhoods on registration form
I have a table called "ad", where I need to register the information coming from other 03 tables, are they: Tables of States, Cities and Neighborhoods. The objective is that the user himself makes…
-
12
votes1
answer1319
viewsDisplay data with Google Chart - Stacked
I’m using the Google Chart - Stacked to create a chart on my system. Even this part is working correctly, as can be seen in the example below: <script…
-
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…
-
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…
-
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…
-
11
votes3
answers5660
viewsHow to keep the element scroll always at the bottom
Consider the following example I’ve done here: $("#add").click(function() { $("#wrap ul").append('<li class="new">Teste</li>'); $("li.new").slideDown('slow', 'easeOutBounce'); });…
-
11
votes1
answer796
viewsHow to bring the total of each column in Footerrow from a jqGrid?
I’m using the property grouping of jqGrid (4.6.0) with jQuery(1.11.0), but I could only generate the total per column and that’s not what I want, I would like the overall total. jqGrid contains the…
-
11
votes1
answer2651
viewsWhat does the CSS selector :first-Child and :last-Child mean?
I have a code using jQuery that was based on CSS selectors :first-child and :last-child (and that worked for a long time), to get the first input and the last input within a group containing input +…
-
11
votes3
answers25097
viewsHow to validate jQuery Validator mobile and landline number?
I need a method of validation of landline and mobile phone with the jQuery Validator plug-in. The differentiation of numbers from fixed to mobile is important to validate the sending of SMS.…
-
11
votes5
answers33239
viewsHow to make a character counter of a textarea?
I tried to make one, but always ran into some limitation. I think my logic will not work, but I still could not think of another. Javascript: $(document).on("keydown", "#TxtObservacoes", function ()…
-
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'…
-
11
votes5
answers29209
viewsReset to input fields after Ubmit with Jquery
By sending input fields values via Jquery to a PHP page I can do the action without "refreshing" the main page but I can’t make input fields "empty" again?!? How to apply "reset" after submission?…
-
11
votes3
answers14892
viewsfunction $.Ajax() return value?
that is the code: var res = VerFileRepetidoBancoAjax( "teste" ); console.log("res="+res); function VerFileRepetidoBancoAjax( str ){ $.ajax({ url: "caminho.", type: "get", dataType:"json", data:…
-
11
votes2
answers11484
viewsHow to make a dynamic form?
I implemented a script that dynamically adds fields to a form, in this case a form to add products and their amount. The code is here: http://jsfiddle.net/3Lzcn7dc/ I find this code very…
-
11
votes3
answers487
viewsNavigate horizontal scroll by pressing tab
I’m using the plugin datatables. I built a table where the first four columns are fixed and the others (which will be generated "dynamically") have input for quantity typing. My intention is that…
-
11
votes1
answer1783
views -
11
votes3
answers1593
viewsFunction as parameter in jQuery functions
I always used some functions without really understanding what was happening and where such parameters came from. I speak of the following: Example 1: $("#link").on("click", function(event){…
-
11
votes3
answers1611
viewsDynamic property name in Javascript
I have the following code: var nomePropriedade = "Propriedade1"; var meuObjeto = { "nome" : "valor" } I would like the property name of meuObjeto received the variable value nomePropriedade. Thus,…
-
11
votes2
answers220
viewsMeaning of append syntax
$("#add_city_btn2").click(function() { var city = $("#add_city2").val(); $("#cities2").append($("<option>", { text: city, selected: "selected"})).change(); $("#add_city2").val(''); return…
-
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.…
-
11
votes3
answers147
viewsHow to put Html snippet on all child elements except the last one?
I have a dynamically generated table, and I want to put a input within each td. I can get the id of the tr, then I do: $("#id").children().html("<input type='text' value='" + valor + "' />");…
-
11
votes5
answers64617
viewsMonetary mask with jquery.inputmask
How do I create a mask for a monetary value? I’m wearing this: $(".ValoresItens").inputmask('R$ 999.999.999,99', { numericInput: true}); was like: R$ ____. ____. _25,00 But I didn’t like these…
-
11
votes4
answers1737
viewsHow to use "wildcard" in "CLASS" selectors with jQuery.expr?
The class selectors as .exemplo or sorted selectors by spacing [atributo~=valor] behave totally different from selectors like: [atributo=valor] [atributo*=valor] [atributo^=valor] The .exemplo and…
jqueryasked 9 years, 4 months ago Guilherme Nascimento 98,651 -
11
votes2
answers51084
viewsSliding effect on anchor links
I have a page Onepage and the anchor links of the menus when clicked them only "jump" to the screen section further down, but I wanted them to slide smoothly up to the intended anchoring section. I…
-
11
votes3
answers580
viewsProblem with the input click
I’m developing a hybrid mobile application, using HTML5 and JS. I have the following problem: when I click, for example, on Nickname, it opens the part of Sex. However, it is a very strange…
-
11
votes2
answers2509
viewsWhat is the function of Function in jQuery and what is the right way or time to use?
Whenever I go to work with jQuery I just create: $(function() { }); Because it was the first way I learned, at first I thought it was a "int main()" pattern in C, but then I came across other forms…
-
10
votes3
answers3264
viewsInvert the order of a jQuery widget list
How to reverse the order jQuery iterates an array of elements? In this case what I would like is to invert the contents of the items within the array. For example: <ul> <li>Item…
-
10
votes4
answers13342
viewsMultiple lines of text or code with method ". html()"
When using the jQuery method .html() to apply multiple lines of text or HTML code to an element, the same error: Example in Jsfiddle $(function(){ $( '.qualquerClasse' ).html( ' conteúdo de 3 linhas…
-
10
votes5
answers18134
viewsUsing jQuery, how to select elements with two CSS classes
I have a div that uses two CSS classes. Here is the HTML : <div class="box1"></div> <div class="box1 destaque"></div> <div class="box2"></div> <div class="box2…
-
10
votes3
answers4291
viewsWhat is the best way to select an option by the text and not by the value in jQuery?
I have a select and would like to select a value according to the text of another field that the user clicked. For example. By clicking a "p" tag with the "April" text I want to select the "April"…
-
10
votes4
answers1193
viewsColor loop in text
I have the following HTML structure: <font class="a">J</font> <font class="b">o</font> <font class="c">ã</font> <font class="d">o</font> <font…
-
10
votes4
answers17125
viewsnet error::ERR_BLOCKED_BY_CLIENT when making Ajax request
I came across a strange error when I tried to execute an ajax request, and I was not very successful in finding solutions. That is the error: The line 199 of forms.js is the $.ajax({ in: $.ajax({…
-
10
votes3
answers581
viewsWhat is the best way to load JS?
I was facing problems with the shipment of JS, mainly by IE8, and I came up with this doubt. I researched a lot, I ended up improving some things. Currently, I upload all JS files at the bottom of…
-
10
votes1
answer9035
viewsScroll bar on a table with bootstrap
I have a table, where I upload database information into it. It has two columns (CNPJ and Social Reason). The table I mounted with bootstrap. I would like her to have a maximum height and create a…
-
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.
-
10
votes2
answers161
viewsHeight property of jQuery and Javascript, what’s the difference?
What’s the difference between $(window).height() from jQuery to the screen.height javascript ? Using them I perceive different results... And what’s similar to screen.height in jQuery ?…
-
10
votes1
answer3152
viewsupload without refresh with Formdata, jquery
I need to update my script and I want to adapt my upload formats to be upados without the need to refresh. I didn’t enjoy using third party script so I researched and came across this function of…
-
10
votes1
answer339
viewsjQuery code works on http://jsfiddle.net but does not work on https://jsfiddle.net
I built the jQuery code in jsFiddle.net to test and it worked properly, however when sending the link, provided by jsFiddle, with https, the code stopped working. Can anyone explain why? I’m using…
-
10
votes2
answers4210
viewshow to represent a monetary field with semicolons in javascript jquery
I’m having a huge doubt. I need to take the values that are in the database with decimals of 3 (for example: 56826.497) and show on the screen the value 56.826,497. I’ve tried using the maskMoney…
-
10
votes1
answer452
viewsjQuery does not use the HTML5 dataset on the date?
When modifying a certain initial value of data from jQuery, I noticed the value of the dataset is not modified. So I drew up the following test: HTML: <div data-value="initial value"…
-
10
votes2
answers934
viewsDetect or block redirect with ajax?
I’m trying a problem with an ajax requisition I’m doing. The requested url is a url x, however, when I do the request, it redirects me to a url y. I’m using the function $.ajax jQuery. I would like…
-
10
votes2
answers2050
viewsHow to show only "x" characters in a div?
Hello, I am developing a system where will be publications, but I would like that, in each publication, shows "x" characters, and passing of this value, shows a button written "Show more", same as…
-
10
votes1
answer383
viewsValidation configuration in dynamic fields
I have a problem which is this, I have the fields: Name, Age and Text; In a part of the system I register that the Text field will only appear if the Name field is equal to PH and the Age field have…
-
10
votes1
answer50008
viewsMasks with jQuery: Phone, CPF and CNPJ
I need to create some masks for CPF, CNPJ and phone. The problem is that I have never used jQuery and have never done any of this before. I would like someone to help me because I searched some…
-
10
votes4
answers1951
viewsUpload with Ajax and formData does not send data
I have a problem and I can not solve, I’m trying to upload via ajax and php, I already got some tips here by SO, But I’m still in trouble, and I know the big chance that I’m doing something stupid…