New answers tagged jquery
0
votes
How To Convert String ' dd/mm/yy hh:MM:ss ' to Date in javascript?
now you can use toLocaleTimeString to format date without using moment or any package. read more
for example
console.log(new Date().toLocaleTimeString(
'en-US', { second: '2-digit', minute: '2-...
0
votes
jquery/ajax set charset header
Just use a UTF-8 page as innerHTML in a parent page that uses other encoding. All browsers can display different encodings in the same page.
0
votes
Javascript Event for "Open in new Tab"
Nowadays we can use pointerdown. It works for both mouse and finger touch.
From Pointer events docs:
Pointer events are DOM events that are fired for a pointing device. They are designed to create a ...
0
votes
How do I change the "Select Language" text in drop-down list of Google translate element to the desired text I want
Try something like this integration.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="...
0
votes
How To get form field values from parent of cloned form button?
You do not need to use an ID property on form elements.
Because there is precisely a hierarchical relationship between the form and its inputs, which are based on their name.
example:
document.forms[0]...
0
votes
Variable value is not changing according to the variable
I am having trouble with my code. Once I get to the end the new value, let reversedArray, gets greyed out. Any suggestions?
function reverseArray(arr) {
let start = 0;
let end = arr.length - 1;
while ...
1
vote
Accepted
Force State/County field to be required in WooCommerce Shipping Calculator
As Shipping state field is displayed optionally depending on the chosen country, you need to target the shipping calculator form changes to set the "required" property, like:
jQuery(function(...
0
votes
Form.io trigger all error messages of each field after clicking terms and conditions
Of course it is possible, I guess you are not targeting it well or something.
Here's a step by step on how to go about it and some simple code snippets that could help.
Step 1: Add Custom Validation ...
0
votes
How to apply event listeners to new elements
I've created a runnable snippet that demonstrates the behavior you desire. Note that I have used INPUTs instead of SPANs, but this doesn't effect how to do it / how to make it work
function ...
0
votes
How to apply event listeners to new elements
Here's how you can modify your code to use event delegation:
Attach the event listeners to a parent element that will contain all the dynamically added input blocks.
Use the .on() method to delegate ...
0
votes
Scroll to element only if not in view - jQuery
I wanted to avoid scrollIntoViewIfNeeded because it's non standard.
This works for me
element.scrollIntoView({ behavior: "smooth", block: "end", inline: "nearest" })
0
votes
jquery datatables hide column
For automatically target always error style
order: [],
columns: [
{data: "no", orderable: false},
{data: "photo" },
{data: "full_name" },
...
-1
votes
-1
votes
Select element within shadow root
dom elemnt=document.querySelector('app-root').querySelector('ion-toast').shadowRoot.querySelector('.toast-container')
const element= await browser.executeScript("return document.querySelector('...
0
votes
Jquery .length keeps returning 0 on LinkedIn page
You need to click it to get it.
Here is a plain js version which does not rely on jQuery
You need to check the selectors. I for example do not find a product-container on a linkedin profile page
...
4
votes
Accepted
Using alias from before() in a it() test
The full example in the edit section is different to the example given above it.
To use the this.werkenBij form of alias you must have a function() based callback, not a () => {} arrow-function ...
0
votes
Javascript : Tippy.js not working for dynamic content
Tippy.js version 6. In the CDN (umd) version, it's available as tippy.delegate() https://atomiks.github.io/tippyjs/v6/addons/#event-delegation
Example:
tippy.delegate('parent', {
target: '.child',
...
0
votes
filtering html table columns with select dropdowns
I do have the same issue and I adopted the solution provided by @Mr. Polywhirl. However, it does not work in my case and I cannot find the problem.
My html is generated dynamically (not static) and I ...
0
votes
Display the all the details of Resident after clicking the view button using ASP.NET Core
I used your codes and test in my side, the ViewModel is created by myself based on your code snippet.
Just like what you can see in the screenshot, using codes below will only display the age ...
1
vote
Accepted
How to resolve Uncaught TypeError from Wave bundle.js when adding Wave.js to Rails 6 app
All I can think of is to check what the canvasElement variable has stored it in, you need it to be an <canvas> element for this Wave constructor. The constructor assumes it is a canvas element, ...
0
votes
Using sub rules via Jquery Validation data-rule attributes
As this is a Plug-In to a library, you need to load the library first. Here is an example.
(function($) {
"use strict";
// This set of validators requires the File API, so if we'ere in a ...
0
votes
How to auto scroll to the focused input field division using javascript or jquery while cloning the form multiple times
1-Select the target element
const targetElement = document.querySelector(`.Reservation[data-reservation-id="${scrollValue}"]`);
(My parent div element has Reservation className and data-...
0
votes
set array items into separate variables
Here is one way to do it:
const labels = ["label1", "label2", "label3", "label4", "label5"];
const [name1, name2, name3, name4, name5] = labels;
console.log('name1=' + name1);
console.log('name5=...
0
votes
How do I prevent a parent's onclick event from firing when a child anchor is clicked?
In case anybody is finding this post and using an anchor tag as their parent element, you should try:
event.preventDefault()
in your child onclick event. Found this solution here: https://...
0
votes
Why does my background flash white when I change the css background property with a transition set?
In your case the reason for the white area is the switch between linear-gradient and solid color. Try changing the "on change" .contact to:
.contact {
background: linear-gradient(#2ea930,...
0
votes
How to copy and apply code from a live demo?
<html>
<head>
<script src="https://code.jquery.com/jquery-git.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>...
2
votes
Why must I load jquery twice before it works
But I don't know why this is the problem...
When jQuery.noConflict() executes, it restores the value of $ to whatever it was before jQuery loaded. As the jQuery documentation on noConflict says:
...
0
votes
How to change from readonly to not readonly of input in ASP.NET Core
You are trying to get the <input> elements under the #modalAddresses and #modalContacts <div> elements and stored in the inputsToModify (global) variable before the elements are rendered.
...
0
votes
Accepted
how to make the side bar close after clicking
You can check event.target to know what element was actually clicked when listening to click event on Body and close the drawer when it is any element other than side-bar opener.
<script src="...
0
votes
jQuery multiselect drop down menu
Try this Multi Select
$(document).ready(function(){
var multipleCancelButton = new Choices('#choices-multiple-remove-button', {
removeItemButton: true,
maxItemCount:5,
...
0
votes
Accepted
Django - select onchange event not working anymore if using jquery-editable-select
I finally found how to do thanks to this link :
https://indrimuska.github.io/jquery-editable-select/
In my example here is what I did :
$('#editable-select-2').editableSelect().on('select.editable-...
1
vote
Accepted
set array items into separate variables
Is this what you want?
const labels = ["label1", "label2", "label3", "label4", "label5"]
var name1 = labels[0];
var name2 = labels[1];
var name3 = ...
0
votes
Copying to clipboard textbox value using jQuery/JavaScript
I preffer this code to copy textbox all text using jquery.
HTML CODE
<input type="text" class="form-control" id="ddlTextBox" />
<button type="button" ...
0
votes
How can Save several objects from several session in Cart in ASP.NET
You can do step3 with Ajax call without refresh page,
something like this:
<script>
$(document).ready(function() {
$('#deliveryForm').on('submit', function(e) {
e.preventDefault(); //...
0
votes
Set jquery code to body page onload
The answer comes 10 years late but hey ... better late than never I guess.
First of all, we separate the code we want to execute into a function. We will call it showNotification(). That name was ...
1
vote
Manage concurrent users per single subscription
how about a low iteration polling, so the client polls the server to let it know its still connected, and then users will automatically be disconnected within about a minute, and on the login screen ...
0
votes
How to start Slick Slider from Left in center mode
I have solved this issue by implementing a workaround to the slick-track in case of variable width is false as this depends on equal width for each slide using onReInit if you are using react-slick ...
0
votes
how to show delete button in top right corner of Image?
Can you give this a try...
For the HTML
<div class="image-area">
<img src="https://blog.codepen.io/wp-content/uploads/2012/06/White-Large.png" alt="Preview"&...
0
votes
Problem with cascading dropdown in Asp.net core mvc
Your codes worked well in myside. See my codes below.
@model WebAppMvc.Controllers.GradeGlass
@* <div class="form-group">
<label asp-for="CurrentGradeId" class="...
0
votes
Functionality like $(document).ready( with Vue.js
Unfortunetly, this.$nextTick() does not guaranty that the DOM render is completed.
If your js function is placed after the mounted() instruction. It may not work (as I experienced).
The last response ...
4
votes
Using alias from before() in a it() test
It does actually depend on the way you are obtaining $element. If you follow the pattern in the documents you quoted, there is no problem.
This passes
beforeEach(() => {
cy.get'some-selector-for-...
1
vote
Accepted
How to Increment the value of a cell in a table by 1 using JavaScript?
To ensure that duplicates of the same item are not added to different rows and that the quantity of an existing row is increased instead, we need to modify the code to check if the item already exists ...
0
votes
How to Show Hide tag Image When one of Owl Carousel item active?
Ensure that the item in the carousel containing #img-dark is set up correctly.
Adjust the jQuery to check for the presence of #img-dark in the active carousel items.
<!DOCTYPE html>
<html ...
0
votes
Update Dom With Result from Ajax with Action Event Not Working
My Problem is Solved Using This Line
$(document).on('click','.add_comment', function(e) {}
My Old Wrong One Was : With Out $(document)
$('#add_comment_'+$comment->id).on('click', function(e) {}
...
0
votes
How to Increment the value of a cell in a table by 1 using JavaScript?
You can't use ++ with a function call, it can only be applied to a variable or an expression that references an object property. So change
tr.find(".qty").val() ++;
to
tr.find(".qty&...
0
votes
Accepted
Not able to send zip file from nodejs express backend to jquery frontend for automatic download
Your jQuery request settings are not correct: responseType should be set under xhrFields, see jQuery.ajax( [settings ] ) > xhrFields
So, replace:
responseType: 'arraybuffer',
with:
xhrFields: {
...
0
votes
Slick Slider responsive breakpoints width is not working
In my case, I was able to fix it by adding
html, body {
width: 100%;
overflow: hidden;
}
0
votes
Spinner for server side processing of jquery datatable
var dataTable = $('#lead_infos').DataTable({
"oLanguage": {
"sEmptyTable": <div class="spinner-border" role="status"> <span class="visually-hidden&...
2
votes
Accepted
how to save changes even user refersh page in jQuery
You save the state of the checkbox and theme when the checkbox is updated, but you don't read that back out and update the DOM when the page first loads. You just need to move your second if statement ...
0
votes
How to get screen width without (minus) scrollbar?
I know this is an old question, but the suggested answer didn't work for me either. I found the following code online and tested it in Chrome, Firefox and Safari where it seems to work fine.
if (...
Top 50 recent answers are included
Related Tags
jquery × 1044911javascript × 587744
html × 255489
css × 142541
ajax × 120501
php × 98732
json × 37020
jquery-ui × 31448
twitter-bootstrap × 27490
asp.net × 26080
asp.net-mvc × 21629
forms × 18696
c# × 17949
angularjs × 15310
wordpress × 15021
arrays × 13605
datatables × 12521
jquery-mobile × 11831
ruby-on-rails × 11803
mysql × 11219
jquery-plugins × 11164
dom × 9335
validation × 8824
jquery-selectors × 8353
iframe × 7384