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

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to include external CSS file in web page?
<body> <script> <link>
<link href="/templ/style.css" rel="stylesheet" type="text/css" />
Which CSS property sets the text size?
font-weight text-decoration font-size
h2 {
  font-size: 1em;
}
Indicate the JavaScript property that can add HTML code into an element.
text value innerHTML
document.getElementById("someID").innerHTML = "HTML content";
Click on the function that returns the number of characters of a string in PHP.
count() strlen() stristr()
$str = "http://CoursesWeb.net/";
$nr_chr = strlen($str);
echo $nr_chr;       // 22
JavaScript Code Snippets

Last accessed pages

  1. jQuery background position (1441)
  2. Multiple Select Dropdown List with JavaScript (4244)
  3. PHP PDO - Select query, fetch (9327)
  4. Rectangle, Oval, Polygon - Star (1008)
  5. Add data from form in text file in JSON format (4892)

Top accessed pages

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