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

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

Daily Test with Code Example

Which attribute is used in <img> tag for the address of the image?
href src rel
<img src="" width="191" height="63" alt="Courses-Web" />
Which CSS code hides the element on page?
display: none; display: inline; position: relative;
#id {
  display: none;
What instruction stops the execution of a while() or for() statement?
continue prompt() break
for(var i = 0; i< 8; i++) {
  if(i > 1) break;
Indicate the function that can create a constant.
define() include() defined()
define("CONSTANT_NAME", "value");
JavaScript Code Snippets

Last accessed pages

  1. AnythingZoomer - Zoom part of Image or Text Content (1055)
  2. sPBM - Simple PHP Backup Manager (719)
  3. PHP PDO - Select query, fetch (14291)
  4. Creating Mask Layers in Flash (3019)
  5. DirectoryIterator to get file and directory info (1489)

Top accessed pages

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