Skip to content
Code Snippets
Useful code to copy and paste
  • ALL
  • Acquia
  • Acquia API
  • Acquia Cloud IDE
  • Acquia Cloud Site Factory
  • Bash
  • Bootstrap
  • C#
  • CSS
  • curl
  • Drupal 8-9
  • Drupal Modules
  • Drush
  • HTML
  • JavaScript
  • jQuery
  • Lando
  • MacOS
  • PHP
  • Raspberry Pi
  • Terminal
  • Unity
  • Website Templates
  • WordPress

Category: HTML

Button Styles (HTML + CSS)

March 26, 2019 Leonardo Signorelli

These are the button styles that our team uses at work, I save them here for an easy copy and…

Continue Reading →

Posted in: Drupal 8-9, HTML, WordPress Filed under: CSS, drupal 8, html, wordpress

Accordion with effect (HTML + JavaScript)

Leonardo Signorelli

Example: https://codepen.io/astralmemories/pen/drEypr Code: <style> .ui-accordion-content a:link, .ui-accordion-content a:hover, .ui-accordion-content a:active, .ui-accordion-content a:visited {   color: #428bca; } </style> <link href=”https://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css” rel=”stylesheet”>…

Continue Reading →

Posted in: Drupal 8-9, HTML, JavaScript Filed under: drupal 8, html, javascript

Tabs with fade effect (HTML + Javascript)

Leonardo Signorelli

Example https://codepen.io/astralmemories/pen/Mxdgoy This code doesn’t work properly in CODEPEN but it will work if you paste it directly to Drupal…

Continue Reading →

Posted in: Drupal 8-9, HTML, JavaScript Filed under: html, javascript, Tabs

Load another page’s item into a div using jQuery.

December 18, 2018 Leonardo Signorelli

Load another page’s item into a div using jQuery: <script src=”https://code.jquery.com/jquery-1.10.2.js”> </script> <div id=”PlaceToPutTable”>&nbsp; </div> <script> $(“#PlaceToPutTable”).load(“https://www.uccs.edu/admissions/request #block-uccsbase-home-content”); </script> More…

Continue Reading →

Posted in: Drupal 8-9, HTML, jQuery Filed under: drupal 8, html, jQuery

Add more height to an Input element using Javascript

July 16, 2018 Leonardo Signorelli

Add more height to an Input element using Javascript: <input type=”text” id=”charAndSymbolsInput” style=”height: 60px; font-size: 20px; line-height: 60px;”> <button type=”button”…

Continue Reading →

Posted in: HTML, JavaScript Filed under: html, javascript

Insert HTML before element in JavaScript

Leonardo Signorelli

With this method (supported by all major browsers, including IE 4), you can take an arbitrary HTML string, and insert…

Continue Reading →

Posted in: Drupal 8-9, HTML, JavaScript, WordPress Filed under: drupal 8, html, javascript, wordpress

Replace the contents of an HTML element (HTML + JavaScript)

June 15, 2018 Leonardo Signorelli

Setting the value of innerHTML lets you easily replace the existing contents of an element with new content. For example,…

Continue Reading →

Posted in: Drupal 8-9, HTML, JavaScript, WordPress Filed under: drupal 8, html, javascript, wordpress

Clear Input Field (HTML + JavaScript)

May 21, 2018 Leonardo Signorelli

Clear Input Field on Focus: <!– When the input field gets focus, replace its current value with an empty string…

Continue Reading →

Posted in: HTML, JavaScript Filed under: html, javascript

Copy Text to Clipboard (HTML + JavaScript)

Leonardo Signorelli

<!– The text field –> <input type=”text” value=”Hello World” id=”myInput”> <!– The button used to copy the text –> <button onclick=”myFunction()”>Copy text</button> <script> function myFunction()…

Continue Reading →

Posted in: HTML, JavaScript Filed under: html, javascript

Auto Select Textarea Text

Leonardo Signorelli

Auto Select Textarea Text: <textarea rows=”10″ cols=”50″ onclick=”this.focus();this.select()” readonly=”readonly”> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod…

Continue Reading →

Posted in: HTML, JavaScript Filed under: html, javascript

Post navigation

Page 2 of 3
← Previous 1 2 3 Next →

If you find my articles useful and would like to show your appreciation, consider buying me a cup of coffee ☕️. Your support is greatly appreciated and helps me continue creating valuable content. Thank you!

Donate
  • ALL
  • Acquia
  • Acquia API
  • Acquia Cloud IDE
  • Acquia Cloud Site Factory
  • Bash
  • Bootstrap
  • C#
  • CSS
  • curl
  • Drupal 8-9
  • Drupal Modules
  • Drush
  • HTML
  • JavaScript
  • jQuery
  • Lando
  • MacOS
  • PHP
  • Raspberry Pi
  • Terminal
  • Unity
  • Website Templates
  • WordPress
Copyright © 2025 Code Snippets — Escapade WordPress theme by GoDaddy