- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Alex Onsman has Published 203 Articles
Alex Onsman
131 Views
The replaceWith( content ) method replaces all matched elements with the specified HTML or DOM elements. This returns the jQuery element that was just replaced, which has been removed from the DOM.Here is the description of all the parameters used by this method −content − Content to replace the matched ... Read More
Alex Onsman
4K+ Views
To replace only text inside a div using jQuery, use the text() method.ExampleYou can try to run the following code to replace text inside a div:Live Demo $(document).ready(function(){ $("#button1").click(function(){ $('#demo').html('Demo text'); }); }); This is it! Replace
Alex Onsman
204 Views
Events are actions that can be detected by your Web Application. When these events are triggered you can then use a custom function to do pretty much whatever you want with the event. These custom functions call Event Handlers.ExampleLet us see an example of bind() jQuery event. Using the jQuery ... Read More
Alex Onsman
332 Views
To handle HTML5 media events using jQuery, use the click() method.ExampleYou can try to run the following code to learn how to handle HTML5 media events such as playing a song:Live Demo $(document).ready(function(){ var x = $(".myPlayer").length; // Count total audio players ... Read More
Alex Onsman
13K+ Views
To work with jQuery Datepicker onchange(), use the datepicker onSelect event. This will show which date we added currently and changed to.ExampleYou can try to run the following code to learn how to work jQuery Datepicker onchange:Live Demo $( function() ... Read More
Alex Onsman
3K+ Views
To pass a jQuery event as a parameter in a method, use the bind() method.ExampleYou can try to run the following code to learn how to apss a jQuery event as a parameter:Live Demo $(document).ready(function(){ $("#btn1").bind("click", { key1: "value1", key2: "value2" }, myFunction); function ... Read More
Alex Onsman
3K+ Views
To disable right click on a page, use the jQuery bind() method.ExampleYou can try to run the following code to learn how to disable right click:Live Demo $(document).ready(function(){ $(document).bind("contextmenu",function(e){ return false; }); }); Right click is disabled on this page.
Alex Onsman
1K+ Views
The jQuery setTimeout() method is used to set an interval for events to fire.ExampleHere, we will set an interval of 3 seconds for an alert box to load using jQuery events:Live Demo $(document).ready(function(){ $("#button1").click(function(){ setTimeout("alert('Hello World!');", 3000); }); }); ... Read More
Alex Onsman
2K+ Views
To detect loading of an image with jQuery, use the load() event handler.Note: The load() method deprecated in jQuery version 1.8. It was completely removed in version 3.0. To see its working, add jQuery version for CDN before 3.0.ExampleYou can try to run the following code to learn how to ... Read More
Alex Onsman
763 Views
To prioritize jQuery events, use the event.stopPropagation().ExampleYou can try to run the following code to learn how to prioritize using stopPropogation() method:Live Demo $(document).ready(function(){ var timer; function out(s) { if (timer) { clearTimeout(timer); ... Read More