Some JavaScript functions and code snippets useful for JavaScript Programmers and JS scripts.
New JavaScript Code Snippets might be added soon.

  1. Show Google Map image with Geolocation JavaScript object
  2. Get Duration of Audio /Video file before Upload
  3. Refresh page if window width changes from a device size to other
  4. Shuffle / Randomize Array in JavaScript
  5. Zodiac Signs JavaScript code
  6. JavaScript strip_tags and stripslashes
  7. array_map and array_search in JavaScript
  8. JavaScript PHP is_ functions to test data type
  9. JavaScript trim, rtrim and ltrim
  10. Difference between two Dates - Time and Date
  11. Get Lower, Higher and Closest Number in JavaScript
  12. Get the value of the selected /checked checkboxes in a form
  13. Replace JavaScript variable name from string with its value
  14. Delete and Add CSS class
  15. Split an alphanumeric string into Array in JavaScript
  16. JavaScript base64 encode decode
  17. MD5 hash string in JavaScript
  18. SHA1 Encrypt data in JavaScript
  19. SHA256 Encrypt hash in JavaScript
  20. SHA512 Encrypt hash in JavaScript
  21. Get search data from URL address in JavaScript
  22. Get Domain Name and other Data from URL
  23. Disable button and Enable it after specified time
  24. Highlight Images on click
  25. Recursive function to create Multi-Level Menu in JavaScript
  26. Show and Hide HTML elements
  27. Select the Content of HTML Element
  28. Convert BBCode to HTML and HTML to BBCode with JavaScript
  29. Add Tag to Selected Text in textarea with JavaScript
  30. Detect when ScrollBar reaches the bottom of the page
  31. Get the Height and Width of web Page and browser Window
  32. Clear Canvas Context
  33. Add Text in Canvas from Input text field, as it is Typed
  34. Keep the first Nr IMG tags, Remove all the others
  35. Delete multiple consecutive characters and Split long words in JavaScript
  36. jQuery Drag and Drop Rows between two similar Tables
  37. Creating Tabs Effect with JavaScript
  38. Follow the mouse cursor with a DIV inside a Parent

Daily Test with Code Example

Which tag is a block element?
<div> <img> <span>
<div>Web Programming and Development</div>
Which CSS code displays the text underlined?
font-style: italic; text-decoration: underline; font-weight: 500;
h2 {
  text-decoration: underline;
Click on the JavaScript function that can access other function after a specified time.
insertBefore() setTimeout() querySelector()
function someFunction() { alert(""); }
setTimeout("someFunction()", 2000);
Click on the instruction that returns the number of items of a multidimensional array in PHP.
count($array) count($array, 1) strlen()
$food = array("fruits" => array("banana", "apple"), "veggie" => array("collard", "pea"));
$nr_food = count($food, 1);
echo $nr_food;       // 6
JavaScript Code Snippets

Last accessed pages

  1. Poppit Stress Buster (221)
  2. Rollercoaster Creator (76)
  3. Zuma Deluxe (10553)
  4. Swimming Lagoon Escape (119)
  5. Butterfly Kyodai (6944)

Top accessed pages

  1. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (47881)
  2. Read Excel file data in PHP - PhpExcelReader (35997)
  3. PHP-MySQL free course, online tutorials PHP MySQL code (35609)
  4. Get Attribute (ID, Class, Name, Title, Src) with jQuery (32107)
  5. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (29381)