Archives: Snippets
IDK…
Forum
// create new element const elem = document.createElement(‘div’) elem.className = ‘quetxt’ // add text elem.innerText = ‘Question:’ elem.style = ‘color:#d55900; font-weight:700; font-size: 18px; margin-top:15px; margin-bottom:10px; font-family:Georgia;’ // grab target element reference const target = document.querySelector(‘.article-header’) // insert the element before…Continue reading
Prevent Copy Paste
document.addEventListener(“contextmenu”, (evt) => { evt.preventDefault(); }, false); document.addEventListener(“copy”, (evt) => { evt.clipboardData.setData(“text/plain”, “You must pay a premium subscription to copy our content”); evt.preventDefault(); }, false);Continue reading
Custom Heading above Qty (Woocommerce)
let qty = document.querySelector(“.e-atc-qty-button-holder”); let text = ` How many card you’re planning to purchase? Choose Quantity of Cards ` qty.insertAdjacentHTML(“afterend” , text);Continue reading
Untitled Snippet
Book Review
/** * Custom shortcode to display WPForms form entries in table view. * * Basic usage: [wpforms_entries_table id=”FORMID”]. * * Possible shortcode attributes: * id (required) Form ID of which to show entries. * user User ID, or “current” to…Continue reading
Logout URL
Toggle switch pricing tabel
$( document ).ready(function() { $(‘.group-two’).hide(); $(‘.change-price’).on(‘click’, function() { $(‘.group-one, .group-two’).toggle(); } ); });Continue reading