Trending questions in JQuery

0 votes
1 answer

How to find a parent with a known class in jQuery?

Hello @kartik, Assuming that this is .d, you can write $(this).closest('.a'); The closest method returns the ...READ MORE

Oct 5, 2020 in JQuery by Niroj
• 82,840 points
7,256 views
0 votes
1 answer

How to pass parameters in GET requests with jQuery?

Hello @kartik, Use data option of ajax. You ...READ MORE

Oct 5, 2020 in JQuery by Niroj
• 82,840 points
7,029 views
0 votes
1 answer

How to set jquery input select all on focus?

Hello @kartik, Try using click instead of focus. It seems to ...READ MORE

Nov 24, 2020 in JQuery by Niroj
• 82,840 points
4,584 views
0 votes
1 answer

How do I pre-populate a jQuery Datepicker textbox with today's date?

Hello @kartik, You must FIRST call datepicker() > then use ...READ MORE

May 29, 2020 in JQuery by Niroj
• 82,840 points
12,201 views
0 votes
1 answer

How do I check if file exists in jQuery or pure JavaScript?

Hello @kartik, With jQuery: $.ajax({ url:'http://www.example.com/somefile.ext', ...READ MORE

Oct 5, 2020 in JQuery by Niroj
• 82,840 points
6,480 views
0 votes
1 answer

How do I iterate through children elements of a div using jQuery?

Hello @kartik, Use children() and each(), you can optionally pass a ...READ MORE

Oct 5, 2020 in JQuery by Niroj
• 82,840 points
5,514 views
0 votes
1 answer

How to set upload_max_filesize in .htaccess?

Hello @kartik, php_value upload_max_filesize 30M is correct. You will ...READ MORE

Oct 27, 2020 in JQuery by Niroj
• 82,840 points
4,150 views
0 votes
1 answer

How to wait until an element exists?

Hello @kartik, DOMNodeInserted is being deprecated, along with the ...READ MORE

Oct 5, 2020 in JQuery by Niroj
• 82,840 points
4,914 views
0 votes
1 answer

How can I convert a DOM element to a jQuery element?

Hello, Use this: var elm = document.createElement("div"); var jelm = ...READ MORE

Nov 25, 2020 in JQuery by Niroj
• 82,840 points
2,491 views
0 votes
1 answer

How to disable HTML links using jquery?

Hello @kartik, Got the fix in css. td.disabledAnchor a{ ...READ MORE

Nov 26, 2020 in JQuery by Niroj
• 82,840 points
2,443 views
0 votes
1 answer

How to add a “readonly” attribute to an <input>?

Hello, For jQuery <1.9 $('#inputId').attr('readonly', true); ...READ MORE

Nov 24, 2020 in JQuery by Niroj
• 82,840 points
1,784 views
0 votes
1 answer

How to Disabling and enabling a html input button?

Hello @kartik, Using jQuery Disabling a html button $('#Button').attr('disabled','disabled'); Enabling a ...READ MORE

Nov 26, 2020 in JQuery by Niroj
• 82,840 points
1,340 views
0 votes
1 answer

How can I detect if a selector returns null?

Hello @kartik, My favourite is to extend jQuery ...READ MORE

Oct 5, 2020 in JQuery by Niroj
• 82,840 points
3,588 views
0 votes
1 answer

How to scroll HTML page to given anchor?

Hello @kartik, Try this: function scrollTo(hash) { ...READ MORE

Nov 26, 2020 in JQuery by Niroj
• 82,840 points
1,283 views
0 votes
1 answer

How to remove an item from a select box?

Hii, Remove an option: $("#selectBox option[value='option1']").remove(); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <select name="selectBox" id="selectBox"> ...READ MORE

Nov 26, 2020 in JQuery by Niroj
• 82,840 points
1,108 views
0 votes
1 answer

What is the difference between jQuery: text() and html() ?

Hello @kartik, The text() method entity-escapes any HTML that is ...READ MORE

Nov 25, 2020 in JQuery by Niroj
• 82,840 points
1,076 views
0 votes
1 answer

How to scroll to element from bottom to top with a nice animation using Jquery?

Hello @kartik, Assuming you have a button with ...READ MORE

Sep 10, 2020 in JQuery by Niroj
• 82,840 points
4,249 views
0 votes
1 answer

How can I determine the direction of a jQuery scroll event?

Hello @kartik, Check current scrollTop vs previous scrollTop var lastScrollTop = 0; $(window).scroll(function(event){ ...READ MORE

Nov 24, 2020 in JQuery by Niroj
• 82,840 points
869 views
0 votes
1 answer

How can selector expression to not select elements with a specific class?

Hello @kartik, You need the :not() selector: $('div[cla ...READ MORE

Nov 26, 2020 in JQuery by Niroj
• 82,840 points
757 views
0 votes
1 answer

How to Get the real width and height of an image with JavaScript?

Hello, Webkit browsers set the height and width ...READ MORE

Nov 25, 2020 in JQuery by Niroj
• 82,840 points
692 views
0 votes
1 answer

Error:jquery each loop return false not end the function

Hii @kartik, Returning from one function doesn't call as it's ...READ MORE

Jun 2, 2020 in JQuery by Niroj
• 82,840 points
7,862 views
0 votes
1 answer

How can I select an element with multiple classes in jQuery?

Hello @kartik, If you want to match only ...READ MORE

Sep 10, 2020 in JQuery by Niroj
• 82,840 points
3,444 views
0 votes
1 answer

How do I check if the mouse is over an element in jQuery?

Hello @kartik, Use this code: $("someelement").mouseenter(function(){ ...READ MORE

Oct 5, 2020 in JQuery by Niroj
• 82,840 points
2,349 views
0 votes
1 answer

How to close all active bootstrap modals on session timeout?

Hello @kartik, Use the following code: $('.modal').modal('hide'); Also if you ...READ MORE

May 12, 2020 in JQuery by Niroj
• 82,840 points
8,388 views
0 votes
1 answer

Error: cannot call methods on dialog prior to initialization; attempted to call method 'close'

Hello @kartik, Looks like your buttons are not ...READ MORE

Apr 28, 2020 in JQuery by Niroj
• 82,840 points
8,933 views
0 votes
1 answer

How to get the first element of an array?

Hello @kartik, Try this: alert(ary[0]) Hope it helps!! Thank you ...READ MORE

Oct 5, 2020 in JQuery by Niroj
• 82,840 points
1,360 views
0 votes
1 answer

How to set data attributes in HTML elements?

Hello @kartik, HTML <div id="mydiv" data-myval="10"></div> JS var a = $('#mydiv').data('myval'); ...READ MORE

Oct 5, 2020 in JQuery by Niroj
• 82,840 points
1,215 views
0 votes
1 answer

How can I refresh a page with jQuery?

Hello @kartik, Use location.reload(): $('#something').click(function() { location.reload(); }); The reload() function ...READ MORE

Sep 10, 2020 in JQuery by Niroj
• 82,840 points
2,167 views
0 votes
1 answer

How to import jQuery UI using ES6/ES7 syntax?

Hii, Add a alias in webpack config: resolve: { ...READ MORE

Apr 28, 2020 in JQuery by Niroj
• 82,840 points
7,965 views
0 votes
1 answer

How to insert an item into an array at a specific index?

Hello @kartik, You can implement the Array.insert method by doing ...READ MORE

Sep 10, 2020 in JQuery by Niroj
• 82,840 points
1,735 views
0 votes
1 answer

How to use $(document).ready equivalent without jQuery

Hello @kartik, Using DOMContentLoaded that is supported by over ...READ MORE

Sep 10, 2020 in JQuery by Niroj
• 82,840 points
1,585 views
+1 vote
2 answers

How to set cache false for getJSON in jQuery?

You can't pass any configuration parameters to ...READ MORE

Oct 7, 2020 in JQuery by Amit
• 140 points
2,931 views
0 votes
1 answer

Error: cannot call methods on button prior to initialization; attempted to call method 'loading'

Hii @kartik, It's caused by jquery-ui and bootstrap-button ...READ MORE

May 12, 2020 in JQuery by Niroj
• 82,840 points
6,562 views
0 votes
1 answer

How can you disable scroll bars in the jQuery UI dialog box?

Hello @kartik, I solved the problem like this: .dialog({ ...READ MORE

May 29, 2020 in JQuery by Niroj
• 82,840 points
5,602 views
0 votes
1 answer

How to refresh a jQuery UI Slider after setting min or max values?

Hello @kartik, You should try doing something like ...READ MORE

May 30, 2020 in JQuery by Niroj
• 82,840 points
5,559 views
0 votes
1 answer

How can I upload files asynchronously?

Hello @kartik, Using JavaScript code you can do it ...READ MORE

Sep 10, 2020 in JQuery by Niroj
• 82,840 points
595 views
0 votes
1 answer

How to get the children of the $(this) selector?

Hello @kartik, The jQuery constructor accepts a 2nd ...READ MORE

Sep 10, 2020 in JQuery by Niroj
• 82,840 points
605 views
0 votes
1 answer

How to get the size of the screen, current web page and browser window?

Hello @kartik, You can get the size of ...READ MORE

Sep 10, 2020 in JQuery by Niroj
• 82,840 points
513 views
0 votes
1 answer

How to check if button is disabled in jQuery Mobile?

Hello, you can try $("#deliveryNext").is(":disabled") The following code works for ...READ MORE

May 29, 2020 in JQuery by Niroj
• 82,840 points
4,626 views
0 votes
1 answer

Uncaught ReferenceError:Karma: jQuery is not defined

Hii @kartik, You first have to load jQuery ...READ MORE

May 12, 2020 in JQuery by Niroj
• 82,840 points
5,102 views
0 votes
1 answer

How to enable Bootstrap tooltip on disabled button?

Hii @kartik, You can wrap the disabled button ...READ MORE

May 12, 2020 in JQuery by Niroj
• 82,840 points
5,099 views
0 votes
1 answer

How to move an item programmatically with jQuery sortable while still triggering events?

Hello, $("selector").trigger("sortupdate"); you will have to  pass as second argument  ...READ MORE

May 29, 2020 in JQuery by Niroj
• 82,840 points
4,239 views
0 votes
1 answer

How to remove close button on the jQuery UI dialog?

Hii, I found this worked for me in the end ...READ MORE

May 12, 2020 in JQuery by Niroj
• 82,840 points
4,633 views
0 votes
1 answer

Error: no such method 'show' for tooltip widget instance

Hello, The root of this and similar problem "no such method ...READ MORE

May 12, 2020 in JQuery by Niroj
• 82,840 points
3,661 views
0 votes
1 answer

How to make Bootstrap popover Appear/Disappear on hover instead of click?

Hello @kartik, Set the trigger option of the popover to hover instead ...READ MORE

May 12, 2020 in JQuery by Niroj
• 82,840 points
3,310 views
0 votes
1 answer

How to attach callback to jquery effect on dialog show?

Hello, Try out the code using jQuery Promise object: $("#dialog").dialog({ ...READ MORE

May 30, 2020 in JQuery by Niroj
• 82,840 points
2,246 views
0 votes
1 answer

JQuery Error: cannot call methods on dialog prior to initialization; attempted to call method 'close'

Hello @kartik, Try this - it works for ...READ MORE

May 29, 2020 in JQuery by Niroj
• 82,840 points
2,014 views
0 votes
1 answer

How to convert form data to JavaScript object with jQuery?

Hello @kartik, You can use: function form_to_json (selector) { ...READ MORE

Apr 28, 2020 in JQuery by Niroj
• 82,840 points
3,109 views
0 votes
1 answer

How to prevent multiple selection in jQuery UI Selectable plugin?

Hii @kartik, What I did is that I allow multiple ...READ MORE

May 30, 2020 in JQuery by Niroj
• 82,840 points
1,230 views
0 votes
1 answer

Twitter Bootstrap: How to see the state of a toggle button?

Hii @kartik, You can see what classes the ...READ MORE

May 12, 2020 in JQuery by Niroj
• 82,840 points
1,677 views