Skip to content

Code Snippets

Useful code to copy and paste
  • ALL
  • Drupal 8
  • HTML
  • JavaScript
  • PHP
  • Unity
  • WordPress

Clear Input Field (HTML + JavaScript)

May 21, 2018 admin Leave a comment

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)

admin Leave a comment

<!– 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

admin Leave a comment

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

Forcing INPUT text to lowercase

May 16, 2018 admin Leave a comment

On every keystroke, a JavaScript event is triggered to convert the value to lowercase. <input type=”text” onkeyup=”this.value = this.value.toLowerCase();”>

Continue Reading →

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

Forcing INPUT text to uppercase

admin Leave a comment

On every keystroke, a JavaScript event is triggered to convert the value to uppercase. <input type=”text” onkeyup=”this.value = this.value.toUpperCase();”>

Continue Reading →

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

Visualizing Influence Maps in C#

May 1, 2018 admin Leave a comment

The code below can be used to generate images so that you can physically see what your map looks like.…

Continue Reading →

Posted in: C#, Uncategorized, Unity

Website Redirects

admin Leave a comment

HTML redirects Perhaps the simplest way to redirect to another URL is with the Meta Refresh tag. We can place…

Continue Reading →

Posted in: Drupal 8, HTML, JavaScript, PHP, WordPress

Concatenate variables in Debug.Log

April 25, 2018 admin Leave a comment

Concatenate in one string: Debug.Log(“Value1: ” + value1variable + ” Value2: ” + value2variable ); Use string.Format if you want to use…

Continue Reading →

Posted in: C#, Unity Filed under: C#, Concatenate, Unity

Post navigation

Page 3 of 3
← Previous 1 2 3

Categories

  • Bash
  • C#
  • CSS
  • Drupal 8
  • Drush
  • HTML
  • JavaScript
  • jQuery
  • PHP
  • Raspbian
  • Terminal
  • Uncategorized
  • Unity
  • WordPress
  • ALL
  • Drupal 8
  • HTML
  • JavaScript
  • PHP
  • Unity
  • WordPress
Copyright © 2021 Code Snippets — Escapade WordPress theme by GoDaddy