Home » Code snippets

HTML, JavaScript, CSS, jQuery Code Snippets/ Examples

This section contains Source Code Snippets/Examples on HTML, JavaScript, CSS and jQuery. Here you will find most useful and popular source codes.

List of all JavaScript, CSS, jQuery Source Code Snippets/Examples

JavaScript (JS) Tutorial

  1. An Introduction to JavaScript (Vanilla JS)
  2. Java vs JavaScript | Differences and Popularities
  3. JavaScript Syntax
  4. Comments in JavaScript
  5. Operators in JavaScript
  6. Bitwise Operators in JavaScript
  7. typeof Operator with Example in JavaScript
  8. delete Operator with Example in JavaScript
  9. Spread Operator in JavaScript
  10. Rest Operator in JavaScript
  11. Booleans in JavaScript
  12. Basic Web Application Development using JavaScript
  13. Where to place JavaScript Code?
  14. Hoisting in JavaScript
  15. How to write an HTML output in JavaScript?
  16. How to write into an HTML element in JavaScript?
  17. JavaScript Type Conversions
  18. JavaScript Variables
  19. const in JavaScript
  20. Constants in JavaScript
  21. Difference between var and let in JavaScript?
  22. 'this' keyword in JavaScript
  23. Assign decimal, octal and hexadecimal values to the variables
  24. Convert decimal to hexadecimal and vice versa
  25. Convert decimal to octal and vice versa
  26. If and Else statement in JavaScript (Vanilla)
  27. break statement with example in JavaScript
  28. continue statement with example in JavaScript
  29. Playing with Number in JavaScript
  30. Understanding Functions and Scopes in JavaScript
  31. How to invoke a function call in JavaScript?
  32. Coercion in JavaScript
  33. Loops in JavaScript
  34. Looping Examples/Programs
  35. Example of jumping statement (break, continue)
  36. maps and for...of loops in Javascript
  37. Arrays in JavaScript
  38. Objects in JavaScript
  39. Properties of Objects in JavaScript
  40. How to iterate over a JavaScript Object?
  41. How to get a key in an object by its value in JavaScript?
  42. How to get the first key name of a JavaScript Object?
  43. How to check if a key exists in a JavaScript Object?
  44. How to access an object having spaces in the object's key using JavaScript?
  45. How to check if an array includes an object in JavaScript?
  46. Convert an array to an object in JavaScript
  47. How to check if a JavaScript object is a DOM object?
  48. How to check object is an array in JavaScript?
  49. Search from Array of Objects | JavaScript
  50. Arrow function in JavaScript
  51. Try Catch to avoid program freeze in JavaScript
  52. Understanding DOM with JavaScript
  53. Interactive Webpages / Event Handling in JavaScript
  54. Nested Event Handling in JavaScript (on mouse move event)
  55. Event Listener in JavaScript with HTML
  56. Web Application: A To-do List using JavaScript
  57. Local Storage using JavaScript
  58. Sorting Methods in JavaScript
  59. JavaScript Math Object (Methods and Examples)
  60. Forms in JavaScript (form validations)
  61. Errors in JavaScript
  62. Debug JavaScript Code
  63. Regular Expressions in JavaScript
  64. Modules in JavaScript
  65. Strict mode in JavaScript
  66. Polyfilling and Transpiling in JavaScript
  67. How to add a class name to an element in JavaScript?
  68. How to change the src of an element in JavaScript?
  69. How to change the class of an element in JavaScript?
  70. Importing and Exporting Modules in JavaScript
  71. Dialog Boxes in JavaScript
  72. Maps vs Objects in JavaScript
  73. Cursor Property in JavaScript
  74. Infinity Property in JavaScript

JavaScript properties

  1. undefined property with Example in JavaScript
  2. NaN property with example in JavaScript
  3. Location protocol property in JavaScript

JavaScript Math Class

  1. Math.abs() Method with Example in JavaScript
  2. Math.sqrt() Method with Example in JavaScript
  3. Math.cbrt() Method with Example in JavaScript
  4. Math.log2() Method with Example in JavaScript
  5. Math.log10() Method with Example in JavaScript
  6. Math.exp() Method with Example in JavaScript
  7. Math.expm1() Method with Example in JavaScript
  8. Math.random() Method with Example in JavaScript
  9. Math.sinh() Method with Example in JavaScript
  10. Math.cosh() Method with Example in JavaScript
  11. Math.tanh() Method with Example in JavaScript
  12. Math.asinh() Method with Example in JavaScript
  13. Math.acosh() Method with Example in JavaScript
  14. Math.atan() Method with Example in JavaScript
  15. Math.atanh() Method with Example in JavaScript
  16. Math.ceil() Method with Example in JavaScript
  17. Math.floor() Method with Example in JavaScript
  18. Math.atan2() Method with Example in JavaScript
  19. Math.clz32() Method with Example in JavaScript

JavaScript Window Class

  1. Window innerWidth and innerHeight Properties in JavaScript
  2. Redirect to a URL in JavaScript

JavaScript Object Class

  1. Object.entries() method in JavaScript

JavaScript built-in functions

  1. escape() function with example in JavaScript
  2. unescape() function with example in JavaScript
  3. fill() function with example in JavaScript
  4. includes() function with example in JavaScript
  5. encodeURI() and decodeURI() functions with example in JavaScript
  6. encodeURIComponent() and decodeURIComponent() functions with examples in JavaScript
  7. parseInt() function with example in JavaScript
  8. isNaN() function with example in JavaScript
  9. Number() function with example in JavaScript
  10. String() function with example in JavaScript
  11. eval() function with example in JavaScript
  12. focus() Method with Example in JavaScript
  13. setInterval() Method with Example in JavaScript

JavaScript String Methods

  1. String toLowerCase() Method with Example in JavaScript
  2. String toUpperCase() Method with Example in JavaScript
  3. String startsWith() Method with Example in JavaScript
  4. String endsWith() Method with Example in JavaScript
  5. String charAt() Method with Example in JavaScript
  6. String charCodeAt() Method with Example in JavaScript
  7. String fromCharCode() Method with Example in JavaScript
  8. String substr() Method with Example in JavaScript
  9. String replace() Method with Example in JavaScript
  10. String indexOf() Method with Example in JavaScript
  11. String lastIndexOf() Method with Example in JavaScript
  12. String search() Method with Example in JavaScript
  13. String concat() Method with Example in JavaScript
  14. Difference between indexOf() and search() methods in JavaScript

JavaScript Number Methods

  1. Number MAX_VALUE Property with Example in JavaScript
  2. Number MIN_VALUE Property with Example in JavaScript
  3. Number isNaN() Method with Example in JavaScript
  4. Number isFinite() Method with Example in JavaScript
  5. Number isInteger() Method with Example in JavaScript
  6. Number toString() Method with Example in JavaScript
  7. Number toExponential() Method with Example in JavaScript
  8. Number toFixed() Method with Example in JavaScript
  9. Number toPrecision() Method with Example in JavaScript

JavaScript Array Methods

  1. Array length property with example in JavaScript
  2. Array constructor property with example in JavaScript
  3. Array isArray() method with example in JavaScript
  4. Array push() method with example in JavaScript
  5. Array pop() method with example in JavaScript
  6. Array shift() method with example in JavaScript
  7. Array unshift() method with example in JavaScript
  8. Array reverse() method with example in JavaScript
  9. Array fill() method with example in JavaScript
  10. Array concat() method with example in JavaScript
  11. Array copyWithin() method with example in JavaScript
  12. Array entries() method with example in JavaScript
  13. Array every() method with example in JavaScript
  14. Array some() method with example in JavaScript
  15. Array filter() method with example in JavaScript
  16. Array find() method with example in JavaScript
  17. Array join() method with example in JavaScript
  18. Array toString() method with example in JavaScript
  19. Difference between join() and toString() Methods in JavaScript

JavaScript Date Methods

  1. Date constructor property with example in JavaScript
  2. Date getDate() method with example in JavaScript
  3. Date getDay() method with example in JavaScript
  4. Date getMonth() method with example in JavaScript
  5. Date getFullYear() method with example in JavaScript
  6. Date getHours() method with example in JavaScript
  7. Date getMinutes() method with example in JavaScript
  8. Date getSeconds() method with example in JavaScript
  9. Date getMilliseconds() method with example in JavaScript
  10. Date getTime() method with example in JavaScript
  11. Get current time in Hours24: Minutes: Seconds format in JavaScript
  12. Get current Date in Date / Month / Year format in JavaScript
  13. Date getTimezoneOffset() method with example in JavaScript
  14. Date getUTCDate() method with example in JavaScript
  15. Date getUTCDay() method with example in JavaScript
  16. Date getUTCMonth() method with example in JavaScript
  17. Date getUTCFullYear() method with example in JavaScript
  18. Date getUTCHours() method with example in JavaScript
  19. Date getUTCMinutes() method with example in JavaScript
  20. Date getUTCSeconds() method with example in JavaScript
  21. Date getUTCMilliseconds() method with example in JavaScript
  22. Get current UTC time in Hours24: Minutes: Seconds format in JavaScript
  23. Get current UTC Date in Date / Month / Year format in JavaScript
  24. now() method with example in JavaScript
  25. Date parse() method with example in JavaScript
  26. Date setDate() method with example in JavaScript
  27. Date setMonth() method with example in JavaScript
  28. Date setFullYear() method with example in JavaScript
  29. Date setHours() method with example in JavaScript
  30. Date setMinutes() method with example in JavaScript
  31. Date setSeconds() method with example in JavaScript

JavaScript (JS) Codes/Examples

  1. Input value from the user using prompt
  2. Example of if with else
  3. Example of if else if
  4. Example of Nested if
  5. Find largest of three numbers using Nested if in JavaScript
  6. Example of Ternary Operator
  7. Image Recognition Game using JavaScript
  8. Code to input age and check person is eligible for voting or not
  9. Function with default value
  10. Function call example with given number of arguments and less arguments
  11. Demonstrate the example of call by value in function
  12. Some of the examples of user-defined functions
  13. Common properties and methods of Array
  14. Code to declare an array and assign the elements using array indexing
  15. Code to declare an array and print using for each loop
  16. Code to declare an array and print using for loop
  17. Password strength checker in JavaScript
  18. Print characters of a string in multiples of N in JavaScript.
  19. How to check whether a string contains a substring in JavaScript?
  20. How to break in nested loops in JavaScript?
  21. Understanding callbacks in JavaScript.
  22. How to create accordions with JavaScript?
  23. JavaScript code to check number is Perfect or not.
  24. JavaScript code to check number is Armstrong or not.
  25. JavaScript code to check whether a Number is Prime or Not.
  26. JavaScript code to find largest of three numbers.
  27. Check number is palindrome or not in JavaScript.
  28. Form validation using JavaScript.
  29. JavaScript code to design calculator.
  30. Disable right click on webpage with JavaScript.
  31. How to make the font bold using JavaScript?
  32. Return multiple elements from function in JavaScript.
  33. How to get URL parameters using JavaScript?
  34. How to copy text to clipboard with JavaScript?
  35. How to get days of current month in JavaScript?
  36. Get browser details through JavaScript.
  37. Calculate the average of arguments in JavaScript.
  38. Ways to access object property in JavaScript.
  39. Count occurrence of a particular character in a string in JavaScript.
  40. Creating a property on prototype in JavaScript.
  41. Create a student object and print the details in JavaScript.
  42. Create a forward and back buttons in JavaScript.
  43. Different ways to create an Object in JavaScript.
  44. How to allow only alphabets in input field in JavaScript?
  45. Get the size of a file with JavaScript.
  46. How to get the decimal part of a floating number in JavaScript?
  47. Get current date, month and year in JavaScript.
  48. How to parse number from string in JavaScript?
  49. How to find absolute value of a number in JavaScript?
  50. Create functions with default arguments in JavaScript.
  51. How to return object from function in JavaScript?
  52. Get index of an element in JavaScript.
  53. Print a fibonacci series in JavaScript.
  54. Find the larger of two numbers in JavaScript.
  55. Convert a number into different base in JavaScript.
  56. Find substring within a string in JavaScript.
  57. Count the number of arguments passed to function in JavaScript.
  58. Ways to create Date object in JavaScript.
  59. Check if number is a valid number in JavaScript.
  60. Determine the largest element in the array in JavaScript.
  61. Addition of two numbers using JavaScript.
  62. Create a user defined array in JavaScript.
  63. Concatenation operator in JavaScript.
  64. New variable declaration keywords in JavaScript.
  65. Dynamically add CSS class with JavaScript.
  66. Reverse an array in JavaScript.
  67. Access global variables inside function in JavaScript.
  68. How to fill dropdowns using JavaScript?
  69. Create a string parser with symbols for actions in JavaScript.
  70. Join elements of an array in JavaScript.
  71. JavaScript multiply every array element with a constant.
  72. JavaScript check if an array element is empty.
  73. Different ways to display output in JavaScript.
  74. Check if an element is present in an Array in JavaScript?
  75. How to change the font-size with JavaScript?
  76. JavaScript Reverse print an array.
  77. Template literals in JavaScript.
  78. How to get the extension of a file using JavaScript?
  79. The JavaScript forEach method in detail.
  80. Generate random number within a range in JavaScript.
  81. JavaScript program to create an object from a function.
  82. JavaScript program to split the keywords in the string.
  83. JavaScript program to check if the variable is a valid string variable.
  84. JavaScript Program to print sum of range with steps.
  85. JavaScript Program to create a power function and print the result.
  86. JavaScript to detect whether page is load on Mobile or Desktop.
  87. JavaScript - Select/Unselect (Check/Uncheck) all CheckBoxes on Button Click.
  88. JavaScript - Allow only numbers in TextBox (Restrict Alphabets and Special Characters).
  89. JavaScript - Redirect to another URL on Button Click.
  90. JavaScript - Display Input Text into Lowercase.
  91. JavaScript - Display Input Text into Uppercase.
  92. JavaScript - Display current Date and Time.
  93. Check selected Radio Button value using JavaScript.
  94. JavaScript function to add two integer numbers.
  95. Show/Hide Div on Button Click using JavaScript.
  96. Display different Alert Message on different Button Click Event using JavaScript.
  97. Display Alert Message on Button Click Event using JavaScript.
  98. JavaScript - Select/Unselect (Check/Uncheck) all CheckBoxes on Button Click.
  99. JavaScript - Print value of all checked (selected) CheckBoxes on Button click.
  100. JavaScript - Print Selected Item from SelectBox.
  101. JavaScript - Add user entered item into ListBox.
  102. JavaScript - Required Field Validator for TextBox on Submit.
  103. JavaScript - Move Object with Arrow Keys using JavaScript Function.
  104. JavaScript - Set Focus on Particular Field in a Form using JavaScript Function.
  105. JavaScript - Set Customize Text in Browser Status Bar using JavaScript Function.
  106. JavaScript - Detect and Display Screen Resolution using JavaScript Function.
  107. JavaScript - Function to Refresh Page on Button Click.
  108. JavaScript - Disable Button after Click using JavaScript Function.
  109. JavaScript - Disable Button after Click using JavaScript Function.
  110. JavaScript - Close Current Tab on Button Click with Confirmation.
  111. JavaScript - Show/Hide Paragraph Text inside Div on Button Click.
  112. Simple Web Dictionary | JavaScript Switch Statement Project
  113. Data Unit Conversion Tool in JavaScript
  114. Age calculator Web Application | Integrating JavaScript function with form
  115. Lowercase to Uppercase Converter JavaScript Tool | Web App Project
  116. Sample report card web application prototype using JavaScript
  117. JavaScript | Create an object and display its values in a table
  118. JavaScript | Create an object and display its content in a table through JavaScript function
  119. JavaScript | Create an object by passing values in the function and display in the table
  120. Capitalize words in a string in JavaScript
  121. How to get multiple random unique elements from an array in JavaScript?



Cascading styles sheet (CSS)

  1. Variables in CSS
  2. Colors in CSS
  3. Measurement Units in CSS
  4. Height and Width in CSS
  5. Padding in CSS
  6. Text Formatting in CSS
  7. Borders in CSS
  8. Changing font in CSS
  9. Margins in CSS
  10. Outlining the content in CSS
  11. Selectors in CSS
  12. Styling Links in CSS
  13. display Property in CSS
  14. overflow Property in CSS
  15. opacity property in CSS
  16. max-width property in CSS
  17. transitions Property using CSS
  18. Positioning elements (The position property) in CSS
  19. The border-radius Property in CSS
  20. clear Property in CSS
  21. Border Images in CSS
  22. Counters in CSS
  23. Multiple columns in CSS
  24. Rounded Corners in CSS
  25. Styling Lists in CSS
  26. How to create an Unordered List without using Bullets using CSS in HTML?
  27. Pseudo Classes | CSS
  28. CSS Box Sizing
  29. How to change link color on hover in CSS?
  30. Style alternate rows of a table with CSS
  31. Change the perspective of an element in CSS
  32. Use custom fonts to webpage with CSS
  33. Flip an image element using CSS
  34. How to set perfect image background with CSS?
  35. Overlap one element over another with CSS
  36. Change image shapes with CSS
  37. Show captions on image hover using CSS
  38. Creating Gradients with CSS3
  39. Vertically center any element in CSS
  40. Rotate fix an image on page with CSS
  41. How to make background image fit on screen using CSS?
  42. How to scale a picture size in CSS?
  43. How to make a div centre align using CSS?
  44. Center any element horizontally in CSS
  45. Styling input placeholder with CSS
  46. Make a drop-cap effect using CSS
  47. Creating a loading animation with CSS
  48. Custom Radio Button Styling with CSS
  49. Basic Shapes in CSS
  50. CSS - Apply Different Style (Color, Background Color) on Even and Odd Table Columns (td)
  51. CSS - Apply Different Style (Color, Background Color) on Even and Odd Table Rows
  52. CSS - Make Two DIVs Left and Right Aligned inside Main DIV
  53. CSS - Make Inner DIV center inside Outer DIV
  54. CSS - Create and Apply CSS for All Buttons on the Page
  55. Navigation Bar using CSS
  56. Creating dropdown in CSS
  57. Web Fonts using CSS
  58. Media Queries in CSS
  59. CSS Grid Container
  60. 2D Transformation using CSS
  61. CSS Text Effects | How to add effects to text using CSS?
  62. CSS Shadow Effects
  63. The scroll-behavior Property in CSS
  64. The pointer-events Property in CSS
  65. The backface-visibility Property in CSS
  66. The caption-side Property in CSS
  67. The object-fit Property in CSS
  68. The order Property in CSS
  69. The quotes Property in CSS
  70. The resize Property in CSS
  71. The user-select Property in CSS
  72. The word-break Property in CSS
  73. Transition shorthand in CSS
  74. Adjusting space between two rows in a table using CSS
  75. Aligning element to the bottom of the div using CSS
  76. Disable text selection highlighting using CSS
  77. Disabling a link using CSS
  78. How to clear floats (clearfix) using CSS?
  79. How to blur an image using CSS?
  80. How to set background image size using CSS?










Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.