<script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js”></script> <script> jQuery(document).ready(function(){ jQuery(‘#btnSubmit’).on(‘click’, function() { jQuery(this).addClass(‘toggle’).removeClass(‘codepen’); }); }); </script> According To Question: #jQuery add remove class onclick codepen #Add Class jQuery […]
Change Div Order In Mobile View By jQuery
Web View […]
How Can I Remove A Specific Item From An Array by jQuery?
//INPUT var array = [2020, 2021, 2022, 2023]; console.log(array); var index = array.indexOf(2020); if (index > -1) { array.splice(index, 1); } // OUTPUT : […]
The best way to detect a mobile device
<html><head><script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js”></script><script>var isMobile = false;if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { // some code write for mobile device… isMobile = true; }else{ isMobile = false; }</script></head><body><div> <center><h1 […]
How do I redirect to another webpage by jQuery?
There are many ways you can do page redirect to another webpage by jQuery. Here I give you two example: 1. Page redirect to another […]
How can I remove a particular value from an array in JavaScript with Example?
<!DOCTYPE html><html> <head> <title>How can I remove a particular value from an array in JavaScript with Example? -PHP Kishan</title> <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js” crossorigin=”anonymous”></script> <script> jQuery(document).ready(function(){ […]
How to redirect another webpage using JavaScript?
<!DOCTYPE html><html> <head> <title>How to redirect another webpage using JavaScript? -PHP Kishan</title> <script> function new_Location(newurl) { /* The wwindow.location […]
How do I set and get a cookie with jQuery?
<script type=’text/javascript’>function setCookie(key, value) { var expires = new Date(); expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000)); document.cookie = key + […]
HTML to PDF Example
<!DOCTYPE html> <html lang=”en-US”> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″/> <title>HTML to PDF Example – PHP Kishan</title> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js”></script> <script src=”https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.5.3/jspdf.debug.js”></script> <script src=”https://html2canvas.hertzen.com/dist/html2canvas.js”></script> <style> .center{text-align: […]
How to set default image on image loaded broken?
<!DOCTYPE html><html class=”” lang=”en-US”><head><meta charset=”UTF-8″ /> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js”></script><script src=”https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.min.js”></script><!– or –><!– <script src=”https://unpkg.com/imagesloaded@4/imagesloaded.pkgd.js”></script> –><style type=”text/css”>.image-thumb {display: inline-block;margin: 10px;}</style></head><body><div id=”product_div”><div class=”image-thumb”><img src=”image/product_01.jpg” class=”thumbnail-img” width=”100″ height=”100″></div><div class=”image-thumb”><img […]