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
-
4
votes1
answer568
viewsHow to schedule an event on datepicker?
I have this code in javascript: $(function() { $("#calendario").datepicker({ changeMonth: true, todayHighlight: true, changeYear: true, showOtherMonths: true, selectOtherMonths: true, dateFormat:…
-
4
votes1
answer2059
viewsWhat is the best way to capture keyboard shortcuts?
Currently I use the keypress approach to capture the Alt pressed and the key that the user wants, however using the Pressed alt can cause compatibility problems in some browsers. For example,…
-
4
votes2
answers634
viewsHow to paint cell according to the value of a select?
I am in need of a help to format a <td> according to the outcome of select PHP. I thought about using jQuery but I don’t know much about it. <tr class=""> <td class=""><?php…
-
4
votes1
answer278
viewsView json value in a div
How to make a value that is in JS appear in html content? app js. // BUSCA OCORRENCIAS $("#menuOcorrencia").click(function() { var operacao = "selectOcorrencias";…
-
4
votes3
answers838
viewsUncheck a checkbox by clicking outside of it
How is it possible to uncheck a checkbox if I click another field of the site? The checkbox is used so that when the status is 'checked', it 'drags' my menu from -65% to 0 and appears on the screen,…
-
4
votes1
answer924
viewsHow to query a web api by passing parameters using Angularjs?
I have the current script: (function () { 'use strict'; var numeros = angular.module("myModule", []) .controller("myController", function ($scope, $http, $log) { var sucessoCalBack = function…
-
4
votes5
answers8294
viewsCount characters while typing
I’m developing a sales website and it has a product Lettering and each letter costs R$10,00. How to calculate the value of a phrase the customer wants to buy? For example, if the customer wants to…
-
4
votes1
answer621
viewsHow to have two or more dynamic filters in the same product group with Javascript?
The code works on the first filter but when I choose the second filter it performs a new search and ignores the first one. How do I get the filters to work simultaneously. Follows the code…
-
4
votes4
answers123
viewsHow to check if one String completes another?
would like to know if there is any function or operator that can check if a String looks like another in javascript for example: var str1 = "joao foi ao mercado"; var str2 = "joao fo"; What I need…
-
4
votes2
answers69
viewsIF to check quantity needed for given KG
I need to do an IF in Javascript. I will explain: A customer sells: Barrels of 40kg. Tube of 3 kg. I don’t know how to do this IF. The idea is, show in the field qtd40kg Only multiples of 40, which…
-
4
votes4
answers9035
viewsMask Car plate in jQuery
I did not find on the Internet a mask in the format BBB-1234 for car plates, the ones I found only validate when the field loses focus and even then only say if it is valid or invalid. You’d need…
-
4
votes1
answer119
viewsdataTables - Add and preserve CSS class to the last column of each row
To add a CSS class to the last column of each row, I use the following method: var dataTablesOptions = { 'columnDefs': [ { targets: -1, className: 'text-center' } ], // ... };…
-
4
votes1
answer2041
viewsHow to set cookies and set expiration time?
I am with a div where I search only logged in users, in it I am displaying users but each update is inserted new records, gave me the tip to use cookise more never worked with it. the following code…
-
4
votes1
answer1086
viewsJSON return from Google API
I make a request to a Google API (API Web Service), in which returns me a JSON (Matrix)... My problem is when trying to extract data that are Arrays within Arrays... As the data from the "Photos"…
-
4
votes1
answer595
viewsHow to get a PHP object in an ajax function
I have the code below that does a check on my controller and it returns me a Count of my request. What I wanted is that in the sucess of my ajax Jquery I capture this value to make some negotiations…
-
4
votes3
answers269
viewsWhat would this Jquery code look like in pure JS?
This code snippet is to activate the . Nav class but in JS it has some options like: classList.toggle('active-nav') but to deactivate when clicking again on pure JS? follows script with Jquery!…
-
4
votes1
answer8624
viewsPerform action after user stops typing with Jquery
I’m doing a search suggest where after the user type at least 4 letters in the input he does via Ajax the search with the suggestions for the user. But currently after the user has typed the first 4…
jqueryasked 8 years, 9 months ago Gabriel Schmidt Cordeiro 728 -
4
votes4
answers8644
viewsHow to take the "src" value of an "img" tag through Javascript and copy it to clipboard?
Guys I want to make sure that when clicking on an image, your url is copied to the clipboard, I tried to use Clipboard but I was only able to make a copy of the text. var a =…
-
4
votes3
answers1015
viewsRemove style added with . css() Function with jQuery
I’m changing CSS with jQuery and need to remove the style I added: if(cor != 'ffffff') $("body").css("background-color", cor); else // remover style ? The line above runs whenever a color is…
-
4
votes3
answers4316
viewsValidating select with jquery.validate
I am creating an application form where there are some selects, as course choice and date of birth, I would like to know how to make mandatory the user select something using this library…
-
4
votes3
answers5001
viewsHover effect on JS
I have a problem that is the following: I want that when the user hovers the mouse on a given image another location wins a class so that I can style it, they could help me? I’m trying this way: var…
-
4
votes3
answers3525
viewsBrazil default date format does not work on bootstrap
I have this datepicker component of bootstrap <div class="col-md-2"> <input id="dataSolicitacao" type="text" name="timepicker" class="b-datepicker form-control form-white"…
-
4
votes2
answers284
viewsHow to use jQuery in MVC Architecture?
We know that MVC is a software architecture standard (Pattern design) which makes a separation of: Vision (User interface), Template (Business rules), Controller that performs communication between…
-
4
votes2
answers1215
viewsDarken screen by clicking on the search bar
On the Americas and Submarine websites, it has an effect that by clicking on the search bar, the entire site is slightly darkened to highlight the search bar. That one I don’t know the name of the…
-
4
votes2
answers2097
viewsMake div appear when right-clicking mouse
Guys I use the function (Hover) to make a DIV appear, I wonder if there is a way to make it appear when right-clicking. That is, a child DIV appears when I click on a parent DIV right-click. Follow…
-
4
votes4
answers3179
viewsHow do DIV fill 100% of the display?
Good afternoon I would like to create a site where the height of the first DIV is 100% of the display displayed to the user, and when giving the scroll, the other elements appear normally. I know…
-
4
votes1
answer292
viewsOpen a div according to your ID
I have a menu that, when right-clicking, it opens in a DIV. Everything happens within a tr (line) of a table. My problem is this, have a table with several tr, and each of them receives a ID. And I…
-
4
votes3
answers910
viewsClose the Bootstrap dropdown by clicking on another dropdown in the same menu?
The menu needs to remain open while I click anywhere on the document or screen, however, when I click on the dropdown of a second menu, it should close the previous one, and also need to open and…
-
4
votes1
answer329
viewsSend multiple values from my Checkbox to an Ajax call
I have a button that when I click calls my ajax function. I want to send the values that were selected in my checkbox.But what comes to my controller is only the first value of my Checkbox., Domingo…
-
4
votes1
answer6938
viewsHow to pick up mouse position relative to page?
I have a menu that opens when I right click on the table. The problem is that I could not get the mouse position when the page has scroll. I noticed that you’re taking the Y X based on my monitor,…
-
4
votes1
answer235
viewscity state Jquery error in selection
Jquery: $(function() { $(document).delegate('#estado', 'change', function() { var valor = $('#estado').val(); $('#cidade').load('_requires/cidades.php?estado=' + valor ); });…
-
4
votes1
answer1269
viewsassign variable with id dynamically via jquery
Hello What I need is this: have a form and on it I mount inputs whose values are the data of a table I run in a loop, I assign an id to each of these imputs with the field name and the number of an…
-
4
votes1
answer234
viewsRecover css with jQuery
Galera set up a table where I click with the right button and the line turns yellow, and displays a menu. Everything works 100%. The problem is that when I click elsewhere and the menu closes and…
-
4
votes1
answer211
viewsAjax locks the computer
Analyze the code below function update(){ $.ajax({ url : 'http://localhost/sistema', type : 'get', dataType : 'json', success : function( data ){ console.log('Mostrar dados: '+.data.dado); } }) }…
-
4
votes3
answers4243
viewsHow to check if return from Ajax is JSON or String?
My code is like this: sendAjax(new FormData(this), function(retorno) { if(retorno.isArray) { $(".erro-login strong").text("ID: " + retorno.id + " usuário: " + retorno.usuario);…
-
4
votes2
answers764
viewsHow to change the value of subsequent inputs?
In a form there are N occurrences of values for the same product, to facilitate I want to apply the same value to the subsequent inputs. For example, using the structure below: <input…
-
4
votes3
answers767
viewsEscape Single and double quotes from the text area even giving Crlt+V
// I just don’t want to let you type in single quotes and double quotes $('#bot').keypress(function (e) { var regex = new RegExp("^[a-zA-Z0-9-]+$"); var str = String.fromCharCode(!e.charCode ?…
-
4
votes2
answers57
viewsI want every time I click on the 'Armchair' function it changes color
function Selecionar(){ var selecionado = document.getElementById("poltronas"); selecionado.style.background = "yellow"; var selecionado = document.getElementById("poltronas");…
-
4
votes2
answers966
viewsHide a div when showing another
I’m having a problem hiding one div when I show another. If I use .conteudo_up instead of the id2 I can do this effect, but it does for everyone at the same time and I want for each one…
-
4
votes1
answer1891
viewsHow to monitor the change of an input type text field?
I need to monitor the change of the content of a text field, the function I use is this: $(document).ready(function() { $("#nome").on("keyup change click focus", function() {…
-
4
votes1
answer908
viewsHow to scroll through a multi-row table and select only one specific table?
I’m trying to do that by clicking on a tr with a unique id, open a slideToggle with another table under the same line that was clicked. I made this example by opening the first and second line, only…
-
4
votes1
answer100
viewsTextboxfor returned Null Post
I have a form where I query an API using jquery. The query returns the data and fills the textboxfor with this data : $.getJSON("//viacep.com.br/ws/" + cep + "/json/?callback=?", function (dados) {…
-
4
votes1
answer150
viewsCreate an instance of jQuery from an array
I have the following array: var elementos = [$("#elemento1"), $("#elemento2"), $("#elemento3")] I need to create a function that "converts" this array into a jQuery instance, so I can use jQuery…
-
4
votes1
answer1745
viewsTake the name and date value (using datepicker), and then calculate using only (JQUERY),
$(function () { $("#datepicker").datepicker({ }); }); <body> <form id="formu"> Nome: <input type="text" id="name"><br> Data de nascimento: <input type="text"…
-
4
votes1
answer477
viewsHow to configure Require.JS
Óla gente, I am in doubt of properly configuring the RequireJS, as I also have doubts about the organization of Trees to configure the baseUrl and so I’m going to demonstrate how I’m configuring: .…
-
4
votes1
answer43
viewsWidth caculum with jquery
Hi I’m making a test site and I have a div of promotions with width of 100%, a ul with 100% width and 4 li with the products. When you are more than 4 li, I want my div promotions to…
-
4
votes4
answers1313
viewsHow to organize alphabetically a select obtained through a JSON?
I rode a select through the JSON below, the only problem is that it follows the order of the key, how to arrange it alphabetically? { "12": "Acre", "27": "Alagoas", "16": "Amapá", "13": "Amazonas",…
-
4
votes1
answer186
viewsDynamically include properties of a $.ajax function
Is there any way to edit the $.ajax function so it includes the "date" property when it receives a value, and remove when it does not receive? that is, dynamically? Example: When the date variable…
-
4
votes1
answer111
viewsSum values in vector and return the value in true condition
I have a doubt in a script where I am doing a quiz, in my last quiz I put 3 response options: A, B and C. Where if the answer is A sum 3 points for option X, 2 points for option Y and 1 point for…
-
4
votes1
answer1855
viewsSubmit form to a php script and open a modal as soon as it is submitted
I have a form that already validates the fields, but I wanted when clicking the send button to send the data to the file recebe.php and already opened a modal that I created. Follow the code on my…